Detailed description of OC helloworld Program

Source: Internet
Author: User
1 # import <Foundation/Foundation. h> 2 3 int main (INT argc, const char * argv []) 4 {5 @ autoreleasepool {6 nslog (@ "Hello world! "); 7} 8 9 return 0; 10}

# Import is provided by the GCC compiler. # import ensures that the header file is referenced only once;

# Import <Foundation/Foundation. h> references the foundation framework in the cocoa combination framework,

Nslog is a function of the foundation framework. Print the function.

Note: Cocoa functions starting with ns are not functions of other toolkit.

@ Symbol is one of the features of Object-C based on the Standard C language library. @ "Hello World" uses the nsstring class of cocoa.

@ Autoreleasepool {} The Pool Program for memory Auto Release is generally written here

 

Detailed description of OC helloworld Program

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.