Objective-C: 05 _ object-oriented-development skills

Source: Internet
Author: User
Math in C language. h has a function: Double POW (double N, double M); Calculate math of C language to the power of M of N. h has a function: Double SQRT (double N); Calculate the value of the root number N (start n). The string in C: char * name = "ZH"; used for output Placeholder: % sNslog (@ "% s", name); nsstring: the simplest way to create a string: nsstring * [email protected] "ZH"; used to output an OC string Placeholder: % @Nslog (@ "% @", STR); Create an OC string using the nsstring method. Stringwithformat (equivalent to string. format in C)Nsstring * STR = [nsstring stringwithformat: @ "My age is $ D and no is % d", age, no]; obtain the length of the current string (the calculated length includes spaces): int Len = [Str Length]; Use placeholders for output : % LDNslog (@ "[email protected]", [STR length]); defines a class with two files:. h declaration file and. m implementation file. . H: Declaration of member variables and Methods . M: Implementation of methodsTo use a class, you only need the. h file of the # import class. # Pragma mark acquisition age: Use this method to mark the code # Pragma mark-Get age: Minus signs indicate adding a horizontal line to the mark.

Objective-C: 05 _ object-oriented-development skills

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.