How can I find out the Objective-C generics type?

前端 未结 2 1472
野性不改
野性不改 2020-12-09 17:01

Xcode 7 contains an Objective-C variant, where you can define a type-hint for (homogenous) NSArray return values and properties, defined such as NSArray&l

2条回答
  •  天命终不由人
    2020-12-09 17:48

    It is not possible to do that.

    Generics were introduced in objective-c to improve the bridge between swift and objective-c. The advantage it gives to objective-c is only useful at compile time, and I that information is lost at runtime.

提交回复
热议问题