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