views:

164

answers:

0

im trying to replace an object inside a nsmutablearrayA (self) with another nsmutablearrayB, but someone when i tried to access the nsmutablearrayB inside of my nsmutablearrayA (self), it returns nil.

i have no idea why it returns nil, here is my code.

I have a nsmutablearray, each contents one UIImage object.

NSMutableArray *tempStoredPreviewImageArray = [[NSMutableArray alloc] init];
    for (int i = 0; i < [[self videoDataArray] count]; i++) {
     [tempStoredPreviewImageArray addObject:[UIImage imageNamed:@"emptypreview2.png"]];
    }
    [self setStoredPreviewImageArray:tempStoredPreviewImageArray];
    [tempStoredPreviewImageArray release];

then i call this methods sometime in my app

[[self storedPreviewImageArray] replaceObjectAtIndex:[index row] withObject:[self arrayOfImages]];

[[self tempAnimationImages] removeAllObjects];

then i tried to read it storedPreviewImageArray

NSLog(@"%i", [[[self storedPreviewImageArray] objectAtIndex:0] count]);

then the log says

2009-09-22 03:37:26.252 xx[3091:20b] 0

why did my nsmutablearray object disappear?