Search code examples
xcodeobjective-c-literals

Command in Xcode to rewrite array creation to use literal syntax


I watched a WWDC video and saw that there is a Refactor option in Xcode that -- boom -- can automatically update your whole code to use the new, more readable notation.

Rather than doing [NSArray arrayWithObjects @"a",@"b",@"c",nil], e.g. , you simply do @[@"a",@"b",@"c"]

Where's the menu item in Xcode that will convert en masse?


Solution

  • Select the target, Menu:Edit:Refactor:Convert to modern Objective-C Syntax.

    enter image description here