The same element is not allowed in the collection collection class, as in Nsset, but if it is written like this: 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/71/F3/ Wkiom1xbh7od61diaaexnbskyzu907.jpg "title=" 1.jpg "alt=" Wkiom1xbh7od61diaaexnbskyzu907.jpg "/>
This will result in the output of the first set being two identical elements, and the output of the second set has only one element
Class Family mode: Because there is no abstract base class in OC, use Factory mode, for example we can create UIButton similar method: 650) this.width=650; "Src=" HTTP://S3.51CTO.COM/WYFS02/M01/72/14 /wkiom1xdf7jhmqazaakbfcemzii099.jpg "title=" 4.png "alt=" Wkiom1xdf7jhmqazaakbfcemzii099.jpg "/> To determine whether the class to which an instance belongs is in the class family, use Iskindofclass to not use Ismemeberofclass, because some classes have internal types
The use of associated objects is actually creating a channel in the local space to share certain classes, such as sharing blocks in Uialert
The message is composed of the object that accepts the message and the function pointer, and if the runtime is not used, the compiler generates the function code that is hardcoded, if dynamic binding is used:
First, use the @dynamic keyword to decorate the properties that need to be dynamically generated, and then override the Resolveinstancemethod method of the class
Second, if the first step still does not find a suitable method, it will call the Forwardingtargetforselector method forward to the other object, always execute to NSObject
Thirdly, if the second step is not successful, it is necessary to start the complete message forwarding mechanism, first create the Nsinvocation object, and encapsulate the message information that has not been processed in this object.
You can change the pointer of IMP in the list of functions in objc_msgsend by means of the method exchange.
OC objects are actually constructed using structs and pointers, using Ismemberofclass to determine if they are instances of a particular class, using Iskindofclass to determine whether they are instances of their classes or derived classes, rather than using [A class] = = [B class]
Read effective Objective c Summary (iii)