Some Objective-C Handy Additions in iOS6

Here are a few small objective-c language additions that were added in iOS6 that I have found myself using a lot recently  and thought I would share them.

You can create a NSNumber easily now with the below line:

NSNumber *number = @3;

You can create a populated array using the below code.

NSArray *fruit = @[@”Apple”,@”Banana”,@”Orange”];

You can create a populated dictionary easily using this line:

NSDictionary *cats = @{ @”Fred” : @”Large”, @”Dave” : @”Small”};

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *


*