我试图将UITableViewController添加到Today Widget,但是每次我将UITableViewController拖到Storyboard并运行该Widget时,它都会崩溃,并显示以下错误。
我已经尝试了多次。我已经尝试通过使用表视图对象,但问题仍然存在。
注意:即使在加载viewDidLoad()方法之前,它也会崩溃。
2015-06-06 01:19:20.569 iOSHackerToday [3202:283287] *由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“ * -[ NSArrayM insertObject:atIndex:]:对象不能为零” ***首次抛出调用堆栈:(0 CoreFoundation 0x0000000107842c65 __exceptionPreprocess + 165 1 libobjc.A.dylib
0x00000001074dbbb7 objc_exception_throw + 45 2 CoreFoundation
0x000000010770f8ca-[__ NSArrayM insertObject:atIndex:] + 954 3
UIKit的0x0000000107d6f0b9 - [UIViewController中_addChildViewController:performHierarchyCheck:notifyWillMove:] + 338 4的UIKit 0x0000000108241a0c - [_ UIViewServiceViewControllerOperator __createViewController:withContextToken:fbsDisplays:appearanceSerializedRepresentations:legacyAppearance:traitCollection:initialInterfaceOrientation:hostAccessibilityServerPort:canShowTextServices:replyHandler:] + 2216 5的CoreFoundation 0x0000000107738dec __invoking_ + 140 6的CoreFoundation 0x0000000107738c42 - [NSInvocation的调用] + 290 7的CoreFoundation
0x00000001077c9016 - [NSInvocation的invokeWithTarget:] + 54 8的UIKit
0x00000001082fd01b - [_ UIViewServiceImplicitAnimationDecodingProxy forwardInvocation:] + 222 9的CoreFoundation
0x000000010779ff4f转发+ 495 10的CoreFoundation
0x000000010779fcd8 _CF_forwarding_prep_0 + 120 11的CoreFoundation
0x0000000107738dec invoking_ + 140 12的CoreFoundation
0x0000000107738c42 - [NSInvocation的调用] + 290 13的CoreFoundation
0x00000001077c9016 - [NSInvocation的invokeWithTarget:] + 54 14的UIKit
0x00000001082889f4 - [_ UIQueueingProxy forwardInvocation:] + 319 15的CoreFoundation 0x000000010779ff4f转发+ 495 16的CoreFoundation 0x000000010779fcd8 _CF_forwarding_prep_0 + 120 17 CoreFoundation
0x0000000107738dec调用_ + 140 18 CoreFoundation
0x0000000107738c42-[NSInvocation调用] + 290 19 CoreFoundation
0x00000001077c9016-[NSInvocation invokeWithTarget:] + 54 20 CoreFoundation 0x000000010779ff4f转发+ 495 21的CoreFoundation 0x000000010779fcd8 _CF_forwarding_prep_0 + 120 22的CoreFoundation
0x0000000107738dec invoking_ + 140 23的CoreFoundation
0x0000000107738c42 - [NSInvocation的调用] + 290 24 libdispatch.dylib 0x0000000109da6f16 _dispatch_call_block_and_release + 12 25 libdispatch.dylib 0x0000000109dc1964 _dispatch_client_callout + 8 26 libdispatch.dylib 0x0000000109daca59 _dispatch_main_queue_callback_4CF + 704 27 CoreFoundation 0x00000001077aa1f9 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 28 CoreFoundation 0x000000010776bdcb __CFRunLoopRun + 2043 29 CoreFoundation 0x000000010776b366 CFRunLoopRunSpecific + 470 30 GraphicsServices
0x000000010b01ca3e GSEventRunal
0x0000000107c3b900 UIApplicationMain + 1282 32 libxpc.dylib
0x000000010a0a7aec _xpc_objc_main + 453 33 libxpc.dylib
0x000000010a0a9e91 xpc_main + 185 34基金会
0x0000000107209ee1 service_connection_handler + 0 35 PlugInKit
0x0000000106ff3a82 - [PKService运行] + 521 36 PlugInKit
0x0000000106ff3747 + [PKService主] + 55 37 PlugInKit
0x0000000106ff3aa6 + [PKService _defaultRun:参数:] + 17 38 libextension.dylib 0x000000010978399d NSExtensionMain + 51 39 libdyld.dylib 0x0000000109df1145 start + 1 40 ??? 0x0000000000000001 0x0 +1)libc ++ abi.dylib:以类型为NSException(lldb)的未捕获异常终止
删除默认布局并拖动新的表视图控制器时,需要将新的视图控制器标记为“ Intial View Controller”
这是Apple的文档,说明了如何执行此操作。https://developer.apple.com/library/ios/recipes/xcode_help-IB_storyboard/chapters/SetInitialController.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句