iphone - Formatting tips for Objective-C nested blocks -


I do not mean to start the holy war formatting code here, but I am thinking that someone has any advice That's the best form of nested blocks in Objective-C.

Here's some code I wrote:

  [UIView animateWithDuration: 1.0 Animation: ^ {self.alpha = 0.5; } Closing: ^ (BOOL Finish) {[UIView Anime with Clutter: 1.0 Animation: ^ {winView.alpha = 1.0; } Closing: ^ (BOOL Finish) {winView.alpha = 0.0; }]; }];  

I give it a lot of Xcode format, and this is not terrible but I am scared for a few to six months, I will stumble to fix some bugs on it, and myself I want to punch on the face

How is it possible for anyone with nested blocks?

Here the real issue takes many block arguments, which make it ugly or difficult. I have not written any actual code that it needs to use yet, but one possibility is that } and ]; Separate in this way:

  [UIView antivirus: 1.0 animation: ^ {shelf.php = 0.5; } Closing: ^ (BOOL Finish) {[UIView Anime with Clutter: 1.0 Animation: ^ {winView.alpha = 1.0; } Closing: ^ (BOOL Finish) {winView.alpha = 0.0; }]; }];  

This breaks the standard formatting of the block (which is } and ]; together), but I think it's a bit Is more readable.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -