Objective-C Auto Unpack with LLVM 4

I looked at autoboxing in Objective-C ( here , for example). Is there any new syntax to unpack?

For example, I want to do this, but in short:

NSArray *oneNumber = @[@1]; int one = ((NSNumber *)oneNumber[0]).intValue; 

the second line syntax is terrible. Is there any new language feature to solve this problem?

+6
source share
2 answers
 [oneNumber[0] intValue] 

Sometimes old ways are better.

+7
source

Another way is to stay in the object world. For instance:

 NSNumber *one = @1; NSArray *oneNumber = @[one]; one = oneNumber[0]; NSLog(@"one %@", one); 
0
source

All Articles