I would like to load UIImages to an array, to add them later to an UITableView.
- (void)imageLoader:(GGImageLoader *)imageLoader didLoadImage:(UIImage *)anImage
{
[myArray addObject:anImage];
[imageLoader release];
}
MyArray is an NSMutableArray defined in the .h File,
If I print the count of myArray its 0 every开发者_如何学Ctime.
Does anybody see the problem?
Thank you in advance..
regards Dennis
Two issues:
- myArray is most likely nil, which explains why its -count is 0 and adding anImage does nothing. You have to declare the pointer variable in your .h file (as you did), but where is myArray = [[NSMutableArray alloc] init]? It should be in one of your initialization methods.
- You probably want to release anImage, not imageLoader.
精彩评论