Jeff V Jeff V - 1 year ago 83
iOS Question

How to define Objective-C lightweight generic for Array of Arrays of NSNumbers?

I have an object with a property of

that contains other
s of
s. I've added a lightweight generic to the property definition in the header file like so:

@property (strong, nonatomic, readonly) NSArray<NSArray *> *myArray;

The generated Swift interface shows:

public var myArray: [[AnyObject]] { get }

Is there a way that I can further mark up my property declaration to indicate that this is actually
? The compiler gets upset with me when I try
NSArray<NSArray *<NSNumber *>> *myArray;
NSArray<NSArray *><NSNumber *> *myArray;

Answer Source
@property (strong, nonatomic, readonly) NSArray<NSArray<NSNumber *> *> *myArray;

All the stars have move to the left.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download