Question

Xcode think that this:

NSArray *persons = @[
    @{
        @"name": @"Bob",
        @"pet": @"cat"
    },
    @{
        @"name": @"Alice",
        @"pet": @"dog"
    }
];

would be better indented like so:

NSArray *persons = @[
@{
@"name": @"Bob",
@"pet": @"cat"
},
@{
@"name": @"Alice",
@"pet": @"dog"
}
];

Can you teach Xcode about indenting Objective-C literals?

Is there another alternative?

Note: I already know I can "force" indent with cmdopt], however this will go away when copying/pasting and will not fix the problem.

Was it helpful?

Solution

Open a bug with http://bugreport.apple.com.

If you also submit it to OpenRadar, people outside Apple can read it. I can point you at this bug report about your specific issue: http://openradar.appspot.com/12394453

The more people who report this problem, the more priority Apple will give it.

OTHER TIPS

Xcode 5 auto-indents like this:

NSArray *persons = @[
                     @{
                         @"name": @"Bob",
                         @"pet": @"cat"
                         },
                     @{
                         @"name": @"Alice",
                         @"pet": @"dog"
                         }
                     ];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top