"Original" objective-c study note _01 "2015-09-16 23:30"

Source: Internet
Author: User

Dynamic binding

Dynamic Typing Dynamics Check

Dynamic linking dynamically linked

#import <Foundation/Foundation.h>

int main (int argc, const char *argv[]) {

@autoreleasepool {//auto-free pool

NSLog (@ "Hello world!"); Want the console output string


return 0;


1 Import header file to prevent duplicate inclusion

Include is to prevent duplicate containment by using pre-processing directives, which cannot be controlled if pre-processing directives are not written

2 The difference between import and @class

3 Foundation and Foundation.h header files. Contains some other header files

Include this header file, equal to the introduction of all OC Library files

4 the difference between NSLog and printf

NSLog can automatically break the log (time + project information) parameter is an object of type NSString

PRINTD cannot wrap a log parameter is a string constant pointer

NSLog formatted output problem:

1 can be formatted output 2 with%@ output string 3 nsstring *str = "ds"; NSLog (@ "%@", str);

The function of the @ symbol:

1 @ Converts a C string into a NSString string object in OC

2 @ identifier OC Most of the keywords start with @


1 single-line comment://

2 Multiline Comments:/* */

3 Documentation Notes:/** */

"Original" objective-c study note _01 "2015-09-16 23:30"

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.