Add objects to NSMutableArray

Posted by iorf on Stack Overflow See other posts from Stack Overflow or by iorf
Published on 2012-03-23T11:27:08Z Indexed on 2012/03/23 11:29 UTC
Read the original article Hit count: 166

Filed under:
|

I'm trying to add objects to NSMutableArray (categoriasArray), but its not done by the iterator:

@synthesize categoriasArray;

for (int i = 0; i < [categories count]; i++) {

        categoria *cat = [[categoria alloc] initWithDictionary:[categories objectAtIndex:i]]; 
        [self.categoriasArray addObject:cat]; 
        cat=nil;

    }

After the for iterator, categoriasArray has 0 objects.

Many thanks

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about ios5