开发者

NSMutableArray of UIImages

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:

  1. 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.
  2. You probably want to release anImage, not imageLoader.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜