dilluns, 20 de gener del 2014

New features of iOS7: method firstObject finally available



Until now, you (and many other people) asked the followed question:
Why NSArray does not have a firstObject method? Well, with iOS 7 finally Apple you can write:


NSArray *array = @[@1, @2, @3]; NSLog(@"First Object: %@", [array firstObject]); // 1 NSLog(@"Last Object: %@", [array lastObject]); // 3

Cap comentari:

Publica un comentari a l'entrada