iphone - Conditional operators in Objective C -


can use conditional operators in objective c in c++. tried implement (condition) ? true-statement : false-statement;

 if(page==1)?(buttonprev.hidden=true):(buttonprev.hidden=false); 

but results error "expected expression"

yes can use. try , don't keep if statement checking condition problem in case.

 (page==1)?(buttonprev.hidden=true):(buttonprev.hidden=false); 

if want assign value directly use

buttonprev.hidden=(page==1)?true:false; 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -