Copy vs mutablecopy
shape
NSNotificationCenter
is a powerful mechanism that allows objects to communicate with each other in a loose coupling way. It is used to broadcast messages (notifications) to interested objects without the need for them to be directly linked. This is especially useful for event-driven programming and for objects that need to respond to changes or specific events in other parts of the application. @selector
is a compiler directive used to represent a selector, which is a type that refers to the name of a method. A selector is essentially a way to refer to a method by its name so that it can be called dynamically during runtime. It is frequently used in contexts like message sending, target-action patterns, and performing selectors. @property
is a directive used to declare a property on an object, which is a getter and setter method for an instance variable (ivariable). It allows the automatic creation of accessors (getter and setter methods) and provides encapsulation and memory management for the instance variables, ensuring a clean and simple interface to interact with an object's data. @synthesize
is a directive used to automatically generate the getter and setter methods for a property, as well as the instance variable (ivar) associated with that property. However, with the introduction of Automatic Reference Counting (ARC) and modern Objective-C, @synthesize
has become less necessary in most cases, as the compiler now automatically synthesizes properties for you by default. But understanding its historical usage and functionality is still important.