objective c - How to Convert an array values into booleans values -


i have array this

myarray=[0,0,1]; 

i want convert array values boolean values below

myarray=[false,false,true]; 

i assign array values strings

mystring=[myarray objectatindex:0]; 

if possible here can convert 0, 1s boolean values.

you can keep way store value. whatever number store bigger one, considered yes when retrieve bool type. however, give actual number if retrieve nsinteger or int. so, use booleanvalue method retrieve so:

nsnumber *value1 = myarray[0]; bool boolvalue1 = [value1 booleanvalue]; 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -