Very confused here…
I have a NSObject subclass called “Section” with a NSMutableArray property called “content”
Section *sectionName = [[Section alloc] init];
[[sectionName content] addObject:@"test"];
[[sectionName content] addObject:@"test2"];
[[sectionName content] addObject:@"test3"];
NSLog(@"COUNT IS %i", [[sectionName content] count]);
Why is my NSLOG showing “COUNT IS 0”??
Are you initializing
contentin your subclass? If not, that can be the problem!Your init method should look like this:
If you’re not using ARC your dealloc should look like this: