0

我有自定义单元格的表格视图。我在表格视图上有 100 张图像。当我运行应用程序时,所有图像都会加载到表格视图中。我也可以从上到下滚动到第 100 个元素。但是在从底部滚动到固定元素中间某处得到以下异常时:

     *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/bc/Library/Application Support/iPhone Simulator/5.1/Applications/B5090983-ACC0-4428-9741-255B7D72F674/ImageCaching.app> (loaded)' with name 'CustomCell''
*** First throw call stack:
(0x159b022 0x172ccd6 0x1543a48 0x15439b9 0x2fd638 0x2feeb7 0x33b7 0x176c54 0x1773ce 0x162c04 0x1716f1 0x11ad42 0x159ce42 0x1f53679 0x1f5d579 0x1ee24f7 0x1ee43f6 0x1f7f1ce 0x1f7f003 0x156f936 0x156f3d7 0x14d2790 0x14d1d84 0x14d1c9b 0x14847d8 0x148488a 0xdc626 0x298d 0x28f5)
terminate called throwing an exception(lldb) 

我有以下表格视图代码:

   NSArray *objects=[[NSBundle mainBundle]loadNibNamed:@"CustomCell" owner:self options:nil];
    NSLog(@"count =%d" ,[objects count]);
    CustomCell *cell=[objects objectAtIndex:0];
    Resource *r=[setUpArray objectAtIndex:indexPath.row];
       cell.cellImage.image=[UIImage imageWithContentsOfFile:[library getResource:r.key]];

我正在准确加载自定义单元格的笔尖名称。请给我一些解决方案。

4

0 回答 0