Keywords in IOS

Source: Internet
Author: User

In the development of iOS, every key word of the system is everywhere, but not every key word is so clear, so Luo listed some key words for everyone to learn from each other, there is imperfect place please correct me, thank you


Atomic Atomic is a thread-protection technique used by OBJC, basically to prevent the data from being read by another thread when the write is not completed. This mechanism is resource-intensive, so nonatomic is a very good choice on small devices such as the iphone, if there is no communication programming between multiple threads.
Super Calling a method of the parent class
ReadOnly The Description property is read-only and the default tag is to read and write
ReadWrite The Description property is read-write, which is also the default property
Retain Frees the old object, assigns the value of the old object to the input object, and then increases the index count of the input object to 1
Self is a hidden parameter that points to the class of the currently calling method
Setter Sets the specified set method
Getter Sets the specified Get method
Property Set the properties of member variables (with read/write, assignment assign,retain,copy, and support for multithreading nonatomic)
End The end of a class header file or implementation file
Copy Create an object with an index count of 1 and then release the old object
Assign Simple assignment without changing the reference count
Synthesize According to the @property setting, the corresponding access method of the member variable is generated automatically, so that the member variable can be accessed conveniently using the point operator.
Import Tell the preprocessor to include the contents of the header file in this file
Dynamic Tell the compiler to implement the Access method by ourselves
Nonatomic Non-atomic access, no lock on attribute assignment, multi-threaded concurrent access improves performance
Implementation Indicates the implementation of the class
Strong Strong references, as long as the last strong pointer no longer points to the object, then the object will be freed, and all weak pointers will be cleared
Weak Weak references
__strong is the default keyword
__weak Declares a weak reference that can be automatically Nil.
__unsafe_unretained Declares a weak application, but does not automatically nil, that is, if the area of memory pointed to is released, the pointer is a wild pointer.
__autoreleasing Used to modify the parameters of a function, which is automatically released when the function returns.
unsafe_unretained Weak references, easy to generate wild pointers, try to use less unsafe_unretained keywords
Synchronized Method plus Lock


Keywords in IOS

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.