【发布时间】:2014-03-07 18:51:35
【问题描述】:
我想我没有在标题中解释清楚,问题就在这里,我有一个从 json 提供的集合视图,但是当我查看详细信息时它崩溃了,我认为问题出在这部分代码中当我将信息发送到详细信息时:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([[segue identifier]isEqualToString:@"detailView"]) {
NSIndexPath *myIndexPath = [self.collectionView indexPathsForSelectedItems];
int row = [myIndexPath row];
MenuDetailViewController *menu = [segue destinationViewController];
EntryJson *entry = [[InfoWeb sharedInstance] entryAtIndex:row];
menu.galeriademo = entry.imagenes;
menu.DetailModalprim = @[entry.title == nil ? @"" : entry.title,
entry.date == nil ? @"" : entry.date,
entry.desc == nil ? @"" : entry.desc,
entry.mainimage == nil ? @"" : entry.mainimage,
entry.seccion == nil ? @"" : entry.seccion];
}
}
在 tableview 中,IndexPath 类似于: NSIndexPath *myIndexPath = [self.collectionView indexpathforselectedRow];
我有一个像这样工作的表格视图,它很好,但是当我更改为集合视图时,我遇到了这个问题。崩溃日志是下一个:
2014-03-07 12:41:00.696 CMT[28640:70b] -[__NSArrayI row]: unrecognized selector sent to instance 0xc34d180
2014-03-07 12:41:00.698 CMT[28640:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI row]: unrecognized selector sent to instance 0xc34d180'
所以我需要你的帮助!谢谢!
【问题讨论】:
标签: ios objective-c uicollectionview