iOS has three multithreaded technologies:
1.NSThread
Created in two ways:
1. Instance method:
-(ID) Initwithtarget: (ID) Target selector: (SEL) Selector object: (ID) argument
You can set thread
Associated Objects mainly has the following three usage scenarios:1. Add a private variable for the existing class to help implement the details2. Add the public attribute to the existing class;3. Create an associated observer for KVO.There are 3
Type-member Type MemberMembers of struct structs are simple, only variables.There are many members of the class:Data member Description Object ( The focus of this lecture )· Instance variable instance variable· Attribute PropertyFunctions member
Hello, I am kellybaby. Today we are going to introduce objective-c language.Friends around the classmate said, I give them to explain the things are always very vernacular, easy to understand, I hope that this vernacular programming language to
First, the origin of the problemAll originated in Apple's official documentation for the sample code for Singleton (Singleton): Creating a Singleton Instance.The main controversy is focused on the following paragraph:
static
Definition and use of the Protocol
What is an agreement?Can be used to declare a whole bunch of methods (cannot declare member variables)As long as a class follows this protocol, it is equivalent to having all the method declarations in this
Block type
Block is a data type that is widely used in iOS development and is highly recommended by Apple, which functions like a function pointer in C.^ is a unique symbol of block.The implementation code for the block is included in the {}.In
Uiimageview+faceawarefillThis category uses the Aspect fill content mode, which can be automatically adjusted to the image content, and when the face is detected, it replaces the center of the image with the center of the face. Test environment:
the method that the class method uses to create the object is the factory method1. Non-reference factory methodcreate an object and give the property a default value. // no reference factory method implementation + (student*) student{ return
Thread synchronization is implemented in 1,objective-c:Mutexlock (mutex), Nscondition Lock (conditional lock) Message delivery2,UDP and TCP:TCP: Transmission Control Protocol, which provides connection-oriented, reliable, point-to-point
There are 3 main usage scenarios for Category: Add a method to an existing class; Splitting the implementation of a class into multiple independent source files; Declares a private method. Implementation Principle : We know that regardless of
Compounding : Combining multiple components together to form a whole and then work with the whole, which is called a compositeThe overall function is more powerful after compoundingWrite a house class, composed of doors, windows and so on, doors
Objective-c delegation and protocol this has no relationship, the agreement as mentioned above, is to play the role of pure virtual class in C + +, for the "delegation" is not related to the agreement, but we often use the Protocol also implement
1 ifMrhiggieismean = NO; if (Mrhiggieismean) { NSLog (@ "confirmed:he is super mean");}2 if ElseBOOL Mrhiggieismean = [Mrhiggie Areyoumean]; if (Mrhiggieismean) { NSLog (@ "confirmed:he is super mean");} Else { NSLog (@ "No, actually he ' s
Objective-c Five main features:
Fully compatible with C
Object oriented
Single Inheritance (functions in OC are virtual functions, pseudo-Multiple inheritance through classes and protocols)
Dynamic binding (when dynamic_cast
In C # and Java, both method and variable have strict access level control, so the use of access levels in Object-c is very rare, perhaps because there is no access level syntax on method, there is nothing to control variables alone. Let's discuss
1, Nsset1. is an unordered collection class that manages multiple objects, with the greatest feature being that duplicate objects are not allowed in the collection, and that the mathematical set meanings are the same2. Other functions and Nsarray
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.