Author: failingProgramMember-eight gods
C # demonstrates the features and functions of multiple languages. The following describes the extension methods introduced from objective-C.
The following example demonstrates an extension method defined in C # For the system. string class:
Namespace extensionmethods {public static class myextensions {public static int wordcount (this string Str) {return Str. Split (New char [] {'', '.', '? '}). Length ;}}}
In objective-C, the extension class method can also implement the same function:
@ Interface nsstring (myextensions) @ property (nonatomic, readonly) int wordcount; @ end @ implementation nsstring (myextensions)-(INT) wordcount {return [self defined: [nscharacterset charactersetwithcharactersinstring: @",.? "];}
This is really an interesting thing. Bill and Steve Jobs are two extremes of mutual fire. They both hate each other very much. no products of the other party will appear in each other's home, but there is a shadow in platform development.
Now I like developing with objective-C rather than using any mono product. The latter provides C # development methods for Android and iOS platforms, but the price is not cheap.
However, xcode's debugging tracking function is not as powerful as Visual Studio, but its installation file must not be smaller than the latter.