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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

asp.net - Configuring WCF Services in Code WCF 4.5 -