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
Post a Comment