开发者

Table image not showing, "Pop an autorelease pool" error

I have a UITableView which uses the following code to display an image in a Table View cell:

cell.imageView.layer.masksToBounds = YES;
    cell.imageView.layer.cornerRadius = 5.0;

UIImage *image = [UIImage imageNamed:[[color types] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
 if ( image ) {
  cell.imageView.image = [image imageScaledToSize:CGSizeMake(50, 50)];
开发者_JS百科 }

It works fine on the iPhone simulator, but when I try it on a real iPhone the iPhone doesn't show. Instead in the console in debugging mode, I get this error:

attempt to pop an unknown autorelease pool (0x851e00)

Any help would be great, thanks.


Check that image != nil. If it == nil then problem in that [[color types] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] code. Generated file name must be equal real file name including extension, case and must not contain whitespaces.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜