我有一个网格视图,我需要显示包含要显示的 URL 的字符串中的网格视图图像。请检查我收到错误的代码
- (void)viewDidLoad
{
_imageDatas=[[NSMutableArray alloc]init];
_imageDatas=[DelegateClass magazine].mg_art_of_sleeping;
NSLog(@"string %@",_imageDatas);
for(int z=0;z< [_imageDatas count]; z++){
NSLog(@"url%@",[[_imageDatas objectAtIndex:z] _image_url]);
}
- (MMGridViewCell *)gridView:(MMGridView *)gridView cellAtIndex:(NSUInteger)index
{
MMGridViewDefaultCell *cell = [[MMGridViewDefaultCell alloc] initWithFrame:CGRectNull];
cell.textLabel.text = [NSString stringWithFormat:@"Cell %d", index];
cell.imageView.image =[UIImage imageNamed:[_imageDatas objectAtIndex:index]];
// cell.imageView.image crash the code
return cell;
}
cell.imageView.image 使代码崩溃并出现错误
2013-03-22 16:25:59.141 Magazine[3890:17c03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ArtOfSleeping pathExtension]: unrecognized selector sent to instance 0x887bb40'
*** First throw call stack:
(0x207c052 0x1ae6d0a 0x207dced 0x1fe2f00 0x1fe2ce2 0xd9c979 0xc716f9 0xd004014 0xc714bd 0xd004072 0x103f2d 0x1054c5 0xc951b3 0x66cc17 0x67f12d 0x59f15d 0x67efd2 0x66ccf1 0x673281 0x66cd17 0x676c5c 0x5fcfb9 0x5feea6 0x5fe580 0x20509ce 0x1fe7670 0x1fb34f6 0x1fb2db4 0x1fb2ccb 0x2318879 0x231893e 0xc56a9b 0x30b5 0x2fb5)