IOS: Learn about the compilers that have been used by XCode

Source: Internet
Author: User

Before talking about the usage of @property, it was mentioned that the change of @property was caused by the change of Xcode, and the root cause was the change of the compiler used by Xcode.  prior to XCODE4, the compiler used by Apple was the GNU C Compiler (GCC).  Since XCode4, Apple has changed Xcode's compiler to low-level Virtual machine (LLVM).  in the GCC compiler era, when declaring a @property, an instance variable (instance variable) must be created for the property; in the LLVM era, you do not have to create an instance variable for this @property, and when LLVM does not find the corresponding instance variable for the property, it is automatically created for it. This instance variable, created automatically in the background, differs from the variable declared by @property only one underscore (_).  code example: @property (copy, nonatomic) NSString *myname;The default hidden instance variable created is: _myname; You directly invoke this _myname instance variable, which is fully available. For example: in the. m file, do the following: _myname = @ "This is my name"; equivalent to self.myname= @ "This is my name";
 Summary:Understanding the compiler history of Xcode helps to understand why some of the syntax in Xcode often changes. @Property change is one of them. Similar changes have been made: in TableView based on storyboard, there is no need to determine whether the reusable cell is empty after Xcode4.

IOS: Learn about the compilers that have been used by XCode

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.