0

I'm having a lot of problems initializing an array of bools. When using the NSLog i keep getting (null). I'm trying to set up the mutable array piecesInPlace with 40 NO's. I've tried changing setupArrayWithFalses to YES for testing purposes, and still get (null).

BOOL setupArrayWithFalses = NO;
for (int i=0; i<40; i++) {
    [piecesInPlace addObject:[NSNumber numberWithBool:setupArrayWithFalses]];
}
NSLog(@"Value of object: %@", [piecesInPlace objectAtIndex:0]);

1 Answer 1

5

are you initializing you array?

piecesInPlace = [[NSMutableArray alloc] init];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.