Wednesday, 7 August 2013

iOS: Best practice for placing the close brace

iOS: Best practice for placing the close brace

I really like to know, which is the best coding practice to have close
brace (}) in Objective C based enterprise project. I would like to define
the method and condition statements like below. Please advise, which is
the best coding practice in Objective C and why. I have not seen about
this in Apple's coding standard document though.
Which is correct, Close brace should be same line or below?
I.
-(void) method {
....
}
(or)
-(void) method
{
....
}
II.
-(void) method {
if ( ... ) {
.....
}
else {
.....
}
}
(or)
-(void) method
{
if ( ... )
{
.....
}
else
{
.....
}
}

No comments:

Post a Comment