let userList:JavaUtilList = JavaUtilArrayList()
I could create an IOSObjectArray:
let arr:IOSObjectArray = userList.toArray()
Now I want to have an NSArray of String
var list: [String] = ???
How can I transform a JavaUtilList or an IOSObjectArray into an NSArray?
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
nsArrayFromList?I get the error Type 'JavaUtilList' does not conform to protocol 'SequenceType'when I try your for loop. |
Are you trolling? It's an example I just wrote. I don't even know if it compiles, but thought it would at least demonstrate the idea. Apparently not. :(
var arrayList:JavaUtilList = // some java arraylist list
var list = arrayList as! NSArray
How can I transform a JavaUtilList or an IOSObjectArray into an NSArray?
+ (instancetype)arrayWithObjects:(const id [])objects
count:(NSUInteger)count)