views:

217

answers:

1

hi,

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)];
 }

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.

A: 

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.

Skie
How do I check that?
Graeme
Simple add after "UIImage *image = [U...." NSLog(@"Image %@", (image)?@"exist":@"not exist");
Skie
OK thanks - the result is "not exist" so I'm not sure what's going on here. In the simulator it does exist, but on the iPhone it doesn't!
Graeme