gpt4 book ai didi

iphone - iOS 7 makeKeyAndVisible 不工作

转载 作者:行者123 更新时间:2023-11-29 03:37:47 28 4
gpt4 key购买 nike

我有一个最初为 iOS 6 编写的应用程序,但现在我希望它能在 iOS 7 上运行。我在 Xcode 5 中打开该项目并编辑了一些内容。它工作正常,除了一条错误消息,如 Need a root view controller before launch(我不记得确切的措辞)。这对我来说似乎很奇怪,因为 rootViewController 已设置并且应用程序仍然工作正常。然后我又编辑了一些,现在当调用 [self.window makeKeyAndVisible] 行时,我收到以下错误消息:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x01f155e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01b058b6 objc_exception_throw + 44
2 CoreFoundation 0x01ec7c3c -[__NSArrayM insertObject:atIndex:] + 844
3 CoreFoundation 0x01ec78e0 -[__NSArrayM addObject:] + 64
4 Nobles 0x00003efd -[AppDelegate addReachabilityDisabledButton:] + 109
5 Nobles 0x00014f4c -[FoodViewController viewDidLoad] + 188
6 UIKit 0x0077e9a8 -[UIViewController loadViewIfRequired] + 696
7 UIKit 0x0077ec44 -[UIViewController view] + 35
8 Nobles 0x000129fa -[MenuViewController viewDidLoad] + 1322
9 UIKit 0x0077e9a8 -[UIViewController loadViewIfRequired] + 696
10 UIKit 0x0077ec44 -[UIViewController view] + 35
11 UIKit 0x006a75ad -[UIWindow addRootViewControllerViewIfPossible] + 66
12 UIKit 0x006a7947 -[UIWindow _setHidden:forced:] + 312
13 UIKit 0x006a7bdd -[UIWindow _orderFrontWithoutMakingKey] + 49
14 UIKit 0x006b244a -[UIWindow makeKeyAndVisible] + 65
15 Nobles 0x000036b2 -[AppDelegate application:didFinishLaunchingWithOptions:] + 2642
16 UIKit 0x00664f65 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
17 UIKit 0x006657a5 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1536
18 UIKit 0x00669fb8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
19 UIKit 0x0067e42c -[UIApplication handleEvent:withNewEvent:] + 3447
20 UIKit 0x0067e999 -[UIApplication sendEvent:] + 85
21 UIKit 0x0066bc35 _UIApplicationHandleEvent + 736
22 GraphicsServices 0x034912eb _PurpleEventCallback + 776
23 GraphicsServices 0x03490df6 PurpleEventCallback + 46
24 CoreFoundation 0x01e90dd5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
25 CoreFoundation 0x01e90b0b __CFRunLoopDoSource1 + 523
26 CoreFoundation 0x01ebb7ec __CFRunLoopRun + 2156
27 CoreFoundation 0x01ebab33 CFRunLoopRunSpecific + 467
28 CoreFoundation 0x01eba94b CFRunLoopRunInMode + 123
29 UIKit 0x006696ed -[UIApplication _run] + 840
30 UIKit 0x0066b94b UIApplicationMain + 1225
31 Nobles 0x00002c2d main + 141
32 libdyld.dylib 0x0317f725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException

在调用此行 if 之前,我检查了 rootViewController 是否为零,但事实并非如此。在这个错误开始之前我没有修改AppDelegate。

有什么想法吗?

提前致谢。

最佳答案

问题似乎出在 -[AppDelegate addReachabilityDisabledButton:] 中,该函数是从 -[FoodViewController viewDidLoad] 调用的。我假设正在传递一个为零的按钮。检查 FoodViewController 的 xib,以确保设置了 socket 。 xibs 的新格式偶尔会给我带来问题,因此可能只需要打开文件,检查 socket 并保存。

如果这不起作用,请在 [FoodViewController viewDidLoad] 设置断点,并尝试检查传入对象的值。

关于iphone - iOS 7 makeKeyAndVisible 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18900482/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com