Boxed expressions
Boxed expressions
- Subject: Boxed expressions
- From: Alex Zavatone <email@hidden>
- Date: Sun, 29 Jul 2012 16:43:03 -0400
While reading Siracusa's Ars Technica Mountain Lion review, I noticed this pearl on pg. 17.
Objective-C enhancementsThis year, Apple further emphasized its apparent belief that enhancing Objective-C can and will lead to a programming language and API that can stand shoulder to shoulder with any of its more moderncompetitors. Objective-C's syntax has been extended to support number, boolean, and collection literals, object subscripting, and boxed expressions. Even if you have no idea what any of that means, I believe you may still find the table below compelling. BEFORE | AFTER |
---|
[array objectAtIndex: i] | array[i] | [dictionary valueForKey: key] | dictionary[key] | [NSArray arrayWithObjects: a, b, c, nil] | @[ a, b, c ] | [NSDictionary dictionaryWithObjectsAndKeys:
value1, key1, value2, key2, nil] | @{ key1: value1, key2: value2 }
|
John doesn't mention which version of Xcode/OC supports these new language extensions. Are they supported for OC in any released version of Xcode?
TIA
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden