Compare the c # language with objective-c and record what you think is similar. Those who have learned objc believe they are no stranger to the category. It allows us to add additional methods to the original class without source code, is it possible to imagine that the extension method in c # is very similar. Yes, although they are called differently, they provide the same functionality. Next, let's talk about Protocol in objc. This is a Class-independent concept. Any class can implement the defined Protocol, which is similar to the interface in c, only the Protocol in objc has two optional and mandatory concepts. What are the two concepts? Optional means that when you implement this Protocol, you can choose to implement it or not, and the required option means you must implement it. How do we know whether the implementation class implements this optional method when the code is running? We can use the runtime characteristics of objc to judge it. The Code is as follows: 1 if ([self. delegate respondsToSelector: @ selector (aSelector)]) 2 {3 [self. delegate aSelector]; 4} In addition, I personally think this is the implementation of function programming in objc, much like lambda in c, however, if we want to access or modify a variable in the block body, we need to add two underscores before the variable so that we can modify it in the block body, it is also an implementation of closures in objc. KVO key value observation allows us to notify us of changes when class attributes change. It is actually an application of the "Observer" mode, this is a bit like the mechanism we implemented using MVVM in WPF. In MVVM, we inherit the VM from INotifyPropertyChanged and use it for notification, in objc, the following methods are used to complete 1-(void) addObserver :( NSObject *) observer forKeyPath :( NSString *) keyPath options :( NSKeyValueObservingOptions) options context :( void *) context; 2-(void) removeObserver :( NSObject *) observer forKeyPath :( NSString *) keyPath; 3-(void) willChangeValueForKey :( NSString *) key; 4-(void) didChangeValueForKey :( NSString *) key; 5-(void) observeValueForKeyPath :( NSString *) keyPath ofObject :( id) object change :( NSDictionary *) change context :( void *) context;