formatting unary ?:

i have space before and after ? and : checked (the default) in options


[newName appendString:[sex ? malePost :femalePost objectAtIndex:[self random:[sex ? malePost :femalePost count]]]];

i have a line like that but it gets formatted without spaces after the : unless i add parenthesis?


[newName appendString:[(sex ? malePost : femalePost) objectAtIndex:[self random:[(sex ? malePost : femalePost) count]]]];



do i really need the parenthesis?

thanks
0
Avatar
Permanently deleted user

it shows

Message select
']' missing

at the question mark, without the parenthessis

0

请先登录再写评论。