Is there a way to make Xcode descriptors more sensible?

In Xcode, if you call a method that takes a series of flags as an argument, when you enter a character in the right bracket, it creates a new left bracket in the last flag, not at the beginning of the line. Is there any way to fix this?

// Type this... someFunc withFlags:FlagA|FlagB|FlagC // Now type a right bracket ] someFunc withFlags:FlagA|FlagB|[FlagC ] // It should be this: [someFunc withFlags:FlagA|FlagB|FlagC] 
+6
source share
3 answers

Enable Xcode-> Settings-> TextEditing-> Editing-> Automatically balance brackets in ObjectiveC method calls

I am using Xcode Version 5.0.2 (5A3005). Below both of them worked great for me. It automatically created a left bracket when I closed the correct one.

  [self someFunc:1 Flag:YES|YES|YES]; [self someFunc:YES|YES|YES]; - (void)someFunc:(int)x Flag:(BOOL)yes { } - (void)someFunc:(BOOL)yes { } 

Here are my Xcode settings

enter image description here

+3
source

Unfortunately, there is no way. Although submitting a bug report to Apple, it will become more likely. If this behavior violates flow , you can always disable it in the settings. Xcode → Settings ... → Text Editing → "Automatically insert closing curly braces ('}')"

+1
source

Enter the first bracket when starting the line. This is what you should do first. You should also use parentheses around your flags.

0
source

All Articles