objective c - Add a (double) variable to NSMutableArray -


i have user input variable , want add array. firststore bool type t determine if array has been initialize. first time store called, initialize array. tried make num equal operand (which double) masking nsnumber doesn't seem work because have error "nsnumber may not respond +operand", program crashes when hits line [memarray addobject:num]. i'm new @ stuff appreciated.

else if ([operation isequal:@"store"]) {     if(!firststore){         memarray = [[nsmutablearray alloc] init];         nsnumber *num = [nsnumber operand];         [memarray addobject:num];         firststore = yes;     } else {          //nsnumber *num = [nsnumber operand];         //[memarray addobject:num];     }  } 

try changing [nsnumber operand] [nsnumber numberwithdouble:operand].


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -