• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Boxed expressions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

http://arstechnica.com/apple/2012/07/os-x-10-8/17/

Objective-C enhancements

This 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.

BEFOREAFTER
[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

  • Follow-Ups:
    • Re: Boxed expressions
      • From: Sean McBride <email@hidden>
    • Re: Boxed expressions
      • From: Jens Alfke <email@hidden>
    • Re: Boxed expressions
      • From: Hunter Hillegas <email@hidden>
  • Prev by Date: Re: Still in the dark
  • Next by Date: Re: Boxed expressions
  • Previous by thread: Re: WebView open URL upon launch of application? (Having issues)
  • Next by thread: Re: Boxed expressions
  • Index(es):
    • Date
    • Thread