Can I use generics in Objective-C for an iOS 8-oriented app?

Is the new Xcode 7 generation function for Objective-C compiler or iOS 9 required?

Is it possible to target iOS 8, but still use generics?

+4
source share
1 answer

This is a compiler function. Everything that happens when you state, for example. NSArray<NSString *> *is that the compiler will then pretend what - addObject:(id)you have instead - addObject:(NSString *), generating the appropriate messages if you specify the wrong type of argument.

- Objective-C, . NSArray, , , . , .

, , NSArray. "" Apple , .

+10

Source: https://habr.com/ru/post/1606773/


All Articles