views:

28

answers:

2

I only have this code in m. file

 NSMutableArray * arrayOfBools;

   arrayOfBools=[[NSMutableArray alloc] initWithCapacity:1000];

NSNumber *ijk =(NSNumber*) 9;

       [arrayOfBools addObject:ijk];                 

Get error o this [arrayOfBools addObject:ijk];

+4  A: 

You can't declare and set an NSNumber like this: NSNumber *ijk =(NSNumber*) 9;. This will set it to an integer (9).

Use this:

NSNumber *ijk = [NSNumber numberWithInt:9];
Rengers
+1  A: 

The third line, the declaration of the NSNumber is incorrect. if you are attempting to wrap a bool into a NSNumber, use NSNumber *test = [NSNumber numberWithBool:YES];

Jesse Naugher