views:

64

answers:

1

I have the following code:

NSLog(@"items: %d", [items count]);
NSLog(@"allObjects: %d", [self.allObjects count]);

[self.allObjects addObjectsFromArray:items];

NSLog(@"allObjects: %d", [self.allObjects count]);

Which produces the following output:

items: 7
allObjects: 0
allObjects: 0

items is a NSArray

allObjects is a NSMutableArray.

I'm confused as to why the objects in items are not being added to allObjects. I expect it's something simple, but there is a hole in my understanding here.

+4  A: 

Let me guess. self.allObjects is nil. Sending messages to nil is a no-op.

KennyTM
*facepalm* Might have to call it a day. Ugh.
Mr. Matt