见下文我做了什么:
我有一个NSArray
有 10 个图像路径,直接从我的本地数据库中获取。每个路径都采用这种格式:/Users/myname/Library/Application Support/iPhone Simulator/6.1/Applications/CC5BE47A-8249-FDDF-90E3-415CEBGGD75AB/Documents/..
我FGallery
用来在网格视图和全尺寸视图中显示图像。当我试图将上述NSArray
方法FGallery
委托给我的应用程序时,我的应用程序正在崩溃。它给了我以下错误:
***** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI pathExtension]: unrecognized selector sent to instance 0xa4e8c70'
**
现在我需要的是:
我需要上述错误的解决方案,为什么我的应用程序在初始化NSArray
有 10 个图像路径到FGallery
委托方法后会崩溃?
添加的代码:
NSString *testString = (NSString *) [[self.allImageGalleryDetails valueForKey:@"imageGallery_Detail_ImagePath"]objectAtIndex:0];
NSArray *array = [[NSArray alloc] initWithObjects:testString, nil];
listofImagePath = array; //Load FGallery View Controller
localGallery = [[FGalleryViewController alloc] initWithPhotoSource:self];
[self.navigationController pushViewController:localGallery animated:YES];
[localGallery release];