[Reading Notes] iOS-category, Reading Notes ios-
1. Category is a way to add new methods to existing classes.
Ii. Category limitations.
1. You cannot add new instance variables to the class. The category does not have a location to accommodate instance variables.
2. Name Conflict, that is, the method in the category must be the same as the existing method. When a name conflict occurs, the category has a higher priority. Your category name will completely replace the initial method, so you cannot use the initial method. Some programmers Add a prefix to their own category method names to ensure that no name conflict occurs.
3. selector.
1. the selector is just a method name, but it is encoded in a special way during the Objective-C runtime to quickly execute the query. You can use @ selector () to pre-compile the instruction selector, where the method name is in parentheses.
2. NSObject provides a method named respondsToSelector: which queries an object to determine whether it can respond to a specific message.
References: Objective-C basic tutorial