IOS Study Notes 20150314, ios20150314

Source: Internet
Author: User

IOS Study Notes 20150314, ios20150314

Objective -- class C and object 1 keyword @ interace class definition @ end class end @ implementation class implementation: inherit @ public @ private @ protected internal subclass can access @ proterty declaration member familiar with get, set @ sythesize implement member variable get, set2 function 3 File. class h declaration B. class m implementation 4 Rules 1 class consists of two files. h and. m. 2: The member variables that inherit the three classes must be defined in, the default modifier is @ Protected4. In ObjC, the recommended member variable name starts with _ 5. Note that in ObjC, both the custom class and the system class object must be a pointer. '65' simplified syntax the syntax for declaring property in a get/SET format is: @ property (parameter 1, parameter 2) type name; for example: C code favorites code @ property (nonatomic, retain) U IWindow * window; the parameters are mainly divided into three types: read/write attributes: (readwrite/readonly) setter semantics: (assign/retain/copy) atomicity: (atomicity/nonatomic) each parameter has the following meanings: readwrite: generate the setter \ getter method readonly: only generate simple getter, no setter. Assign: the default type. The setter method directly assigns values without retain operations. retain: the setter method performs the release old value on the parameter, and then retain the new value. Copy: the setter method performs Copy operations. Like retain, nonatomic: multithreading is prohibited, variable protection is disabled, and parameters of the parameter type to improve performance are more complex: retain and copy. The specific analysis is as follows:

 

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.