在iOS中使用添加到空应用程序的UITableView和故事板时发生SIGABRT错误?
我正在使用UITableView显示从webservice获取的数据。获取操作完成得很好,并在控制台中显示数据。但是我得到了SIGABRT错误。我还向空应用程序添加了故事板,如果这导致了任何问题,我不确定。在这里应该做什么 以下是描述:-在iOS中使用添加到空应用程序的UITableView和故事板时发生SIGABRT错误?,ios,objective-c,uitableview,Ios,Objective C,Uitableview,我正在使用UITableView显示从webservice获取的数据。获取操作完成得很好,并在控制台中显示数据。但是我得到了SIGABRT错误。我还向空应用程序添加了故事板,如果这导致了任何问题,我不确定。在这里应该做什么 以下是描述:- -[__NSDictionaryM objectAtIndex:]: unrecognized selector sent to instance 0xcb38930 2014-06-17 13:25:06.961 Sus
-[__NSDictionaryM objectAtIndex:]: unrecognized selector sent to instance 0xcb38930
2014-06-17 13:25:06.961 SushrutTest[879:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM objectAtIndex:]: unrecognized selector sent to instance 0xcb38930'
*** First throw call stack:
(
0 CoreFoundation 0x01a985e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0181b8b6 objc_exception_throw + 44
2 CoreFoundation 0x01b35903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01a8890b ___forwarding___ + 1019
4 CoreFoundation 0x01a884ee _CF_forwarding_prep_0 + 14
5 SushrutTest 0x0000380e -[ListViewController tableView:cellForRowAtIndexPath:] + 334
6 UIKit 0x0067cd2f -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 412
7 UIKit 0x0067ce03 -[UITableView _createPreparedCellForGlobalRow:] + 69
8 UIKit 0x00661124 -[UITableView _updateVisibleCellsNow:] + 2378
9 UIKit 0x006745a5 -[UITableView layoutSubviews] + 213
10 UIKit 0x005f8dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
11 libobjc.A.dylib 0x0182d81f -[NSObject performSelector:withObject:] + 70
12 QuartzCore 0x0452472a -[CALayer layoutSublayers] + 148
13 QuartzCore 0x04518514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
14 QuartzCore 0x04526b55 -[CALayer(CALayerPrivate) layoutBelowIfNeeded] + 43
15 UIKit 0x005eb7e6 -[UIView(Hierarchy) layoutBelowIfNeeded] + 595
16 UIKit 0x005eb58d -[UIView(Hierarchy) layoutIfNeeded] + 74
17 UIKit 0x006c75a4 -[UINavigationController _layoutViewController:] + 1062
18 UIKit 0x006c67c6 -[UINavigationController _layoutTopViewController] + 176
19 UIKit 0x006c49f5 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 429
20 UIKit 0x008b3732 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 328
21 UIKit 0x008b3a37 -[UINavigationTransitionView _cleanupTransition] + 703
22 UIKit 0x008b3a76 -[UINavigationTransitionView _navigationTransitionDidStop] + 55
23 UIKit 0x005da81c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
24 UIKit 0x005d9005 +[UIViewAnimationState popAnimationState] + 334
25 UIKit 0x005ed866 +[UIView(Animation) commitAnimations] + 36
26 UIKit 0x008b3535 -[UINavigationTransitionView transition:fromView:toView:] + 2795
27 UIKit 0x008b2a42 -[UINavigationTransitionView transition:toView:] + 55
28 UIKit 0x006c83d7 -[UINavigationController _startTransition:fromViewController:toViewController:] + 3186
29 UIKit 0x006c872c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
30 UIKit 0x006c9349 -[UINavigationController __viewWillLayoutSubviews] + 57
31 UIKit 0x0080239d -[UILayoutContainerView layoutSubviews] + 213
32 UIKit 0x005f8dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
33 libobjc.A.dylib 0x0182d81f -[NSObject performSelector:withObject:] + 70
34 QuartzCore 0x0452472a -[CALayer layoutSublayers] + 148
35 QuartzCore 0x04518514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
36 QuartzCore 0x04524675 -[CALayer layoutIfNeeded] + 160
37 UIKit 0x006b3ca3 -[UIViewController window:setupWithInterfaceOrientation:] + 304
38 UIKit 0x005d2d27 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5212
39 UIKit 0x005d18c6 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
40 UIKit 0x005d1798 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117
41 UIKit 0x005d1820 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67
42 UIKit 0x005d08ba __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120
43 UIKit 0x005d081c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
44 UIKit 0x005d1573 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870
45 UIKit 0x005d4b66 -[UIWindow setDelegate:] + 449
46 UIKit 0x006a5dc7 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180
47 UIKit 0x005ca7cc -[UIWindow addRootViewControllerViewIfPossible] + 609
48 UIKit 0x005ca947 -[UIWindow _setHidden:forced:] + 312
49 UIKit 0x005cabdd -[UIWindow _orderFrontWithoutMakingKey] + 49
50 UIKit 0x005d544a -[UIWindow makeKeyAndVisible] + 65
51 UIKit 0x005888e0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
52 UIKit 0x0058cfb8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
53 UIKit 0x005a142c -[UIApplication handleEvent:withNewEvent:] + 3447
54 UIKit 0x005a1999 -[UIApplication sendEvent:] + 85
55 UIKit 0x0058ec35 _UIApplicationHandleEvent + 736
56 GraphicsServices 0x038a82eb _PurpleEventCallback + 776
57 GraphicsServices 0x038a7df6 PurpleEventCallback + 46
58 CoreFoundation 0x01a13dd5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
59 CoreFoundation 0x01a13b0b __CFRunLoopDoSource1 + 523
60 CoreFoundation 0x01a3e7ec __CFRunLoopRun + 2156
61 CoreFoundation 0x01a3db33 CFRunLoopRunSpecific + 467
62 CoreFoundation 0x01a3d94b CFRunLoopRunInMode + 123
63 UIKit 0x0058c6ed -[UIApplication _run] + 840
64 UIKit 0x0058e94b UIApplicationMain + 1225
65 SushrutTest 0x00003b2d main + 141
66 libdyld.dylib 0x020d4725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
您正在从CellForRowatineXpath方法中的NSDictionary对象询问-objectAtIndex:
NSDictionary不知道objectAtIndex,但NSArray知道。所以当你想要一个数组时,你会得到一个字典
显示cellForRowAtIndexPath的内容以获得进一步提示。您正在混淆NSDictionary和NSArray对象。如消息中所述,您没有
objectAtIndex选择器。可能您从服务器获得JSON响应,您以某种方式将其解析为Objective C对象,但解析的对象是NSDictionary,您必须获得所需的数组,该数组可能是该字典中键的对象。
-[__NSDictionaryM objectAtIndex:]: unrecognized selector sent to instance 0xcb38930