1. Attribute readwrite,readonly,assign,retain,weak,strong,copy,nonatomic, function of atomic, use situation and attention point
(1). ReadWrite Features: readable writable; Condition: Generate getter, setter method; "Note": If no member variable is created directly;
(2). ReadOnly Features: Read-only, does not generate setter methods; conditions: Do not allow attributes to change outside the class; "Note": Only getter methods are generated;
(3). Assign property: Assignment, setter method assigns the passed parameter to the instance variable; case: just set the variable; "Note": After the Assign-modified (pointer) object is released in MRC mode, the pointer still points to the original place. In Arc mode, when the function is similar to the weak object, the pointer is automatically set to nil;
(4). Retain characteristics: Hold, setter method will pass in the parameters of the first reservation, and then assign value; case: Retaincount of incoming parameters +1; "Note": In principle, assign and retain are not available in Arc mode, But the compiler relaxes the requirements (it doesn't matter if it's written), and the property decorations that are almost identical to the Retain feature in Arc mode are strong (strong references);
(5). Copy attribute: Assignment, setter method copy an incoming object, case: Generally only used to decorate nsstring;
(6). Nonatomic Characteristics: Non-atomic operation, determines whether the compiler generated setter,getter is atomic operation; situation: improve efficiency;
(7). Atomic Features: Atomic operations, providing multithreading security, preventing threads from being read by other threads when they are not completed (which can result in data errors); Conditions: Actions that cannot be interrupted "note": General use of nonatomic;
2.NSInteger is not a subclass of Nsnumber/nsobject and is the base data type (an alias of Int/long), depending on whether the system is 32-bit or 64-bit to determine whether it is an int or a long.
3. Difference between notice and agreement
The protocol can be seen as a one-to-many understanding of life, but it has a chain of control relationships, and notifications are not. Boss of the work agent is not through the staff, each employee for the boss work, boss to pay for each employee, is not to send cat wages to dog, (it is not a kind of)
Notifications can be one-to-many, a message to multiple recipients, such as financial notice: The company's employees in xx xx point to XX to receive the salary bar. Notifications are only concerned with giving notice.
iOS face question accumulation