开发者

NSMutableArray of UIImages

开发者 https://www.devze.com 2023-03-13 04:32 出处:网络
I would like to load UIImages to an array, to add them later to an UITableView. - (void)imageLoader:(GGImageLoader *)imageLoader didLoadImage:(UIImage *)anImage

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

精彩评论

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

关注公众号