Xcode 4模板在iOS 3.1.2中不起作用

| 我想为较旧的手机测试我的应用程序,并使用3.1.2进行测试。但是,当我尝试运行它时,它仅显示启动屏幕,然后崩溃。 然后,我尝试从Xcode 4模板制作一个新的基于Hello World视图的应用程序,但是即使有了这个模板,它也可以正常运行,但在启动时崩溃。我将部署目标设置为3.1。 如果我尝试使用iPad 3.2模拟器运行此设备,它也会崩溃。 问题出在哪里? 当我在iOS设备上运行它时,它会发出警告,然后停止,而不是真正崩溃: 警告:检测到UUID与加载的库不匹配-在磁盘上是:     /开发人员/平台/iPhoneOS.platform/DeviceSupport/3.1/Symbols/System/Library/Priv 更新: 我发现由于某种原因,我之前在DeviceSupport文件夹中将3.1.2(7D11)快捷方式设置为3.1.2。我删除了它,现在我不再收到警告了。只是崩溃;)   0 gdb-arm-apple-darwin   0x000000010010974a internal_vproblem +   308 1 gdb-arm-apple-darwin   0x0000000100109924 internal_verror +   27 2 gdb-arm-apple-darwin   0x00000001001099c2 align_down + 0 3   gdb-arm-apple-darwin   0x0000000100150c5e macosx_solib_add +   794 4 gdb-arm-apple-darwin   0x000000010016417c   remote_macosx_complete_create_or_attach   + 187 5 gdb-arm-apple-darwin 0x000000010016489e   remote_macosx_create_inferior + 1252 6   gdb-arm-apple-darwin   0x000000010005f6c3 run_command_1 + 586   7 gdb-arm-apple-darwin   0x0000000100107b7f execute_command +   557 8 gdb-arm-apple-darwin   0x00000001000171e7   mi_execute_async_cli_command + 204 9   gdb-arm-apple-darwin   0x00000001000168e5   capture_mi_execute_command + 344 10   gdb-arm-apple-darwin   0x0000000100072a62 catch_exception +   57 11 gdb-arm-apple-darwin   0x000000010001443e mi_execute_command   + 140 12 gdb-arm-apple-darwin 0x0000000100077721 process_event + 133   13 gdb-arm-apple-darwin   0x0000000100078435 gdb_do_one_event +   1049 14 gdb-arm-apple-darwin   0x0000000100072b49 catch_errors + 70   /SourceCache/gdb/gdb-1518/src/gdb/macosx/macosx-nat-dyld.c:1648:   内部错误:无法识别的共享   库断点内部问题   已检测到GDB,进一步   调试可能不可靠。 当我运行iPad模拟器时,它在HelloWorldAppDelegate.m中的此行崩溃:     self.window.rootViewController = self.viewController; 与此消息: 2011-04-21 11:46:09.006 HelloWorld [5492:207] *-[UIWindow setRootViewController:]:无法识别的选择器已发送到实例0x4c11bb0 2011-04-21 11:46:09.007 HelloWorld [5492:207]由于未捕获的异常\'NSInvalidArgumentException \',终止应用程序,原因:\'**-[UIWindow setRootViewController:]:无法识别的选择器已发送至实例0x4c11bb0 \' 更新: 这可以通过以下方法解决:
//  self.window.rootViewController = self.viewController;
    [self.window addSubview: [self.viewController view]];
    
已邀请:
在您的应用程序委托中使用
[window addSubview: [myRootViewController view]];
代替
[window: setRootViewController: myRootViewController];
。     
我遇到了与您完全相同的问题,并且我从Xcode 4模板创建的每个应用程序都会给我您描述的错误。通过查看Xcode 4的在线文档中包含的一些示例代码,我发现如果我更换了它,它就可以在运行3.1.3的iPhone 3G上运行。
self.window.rootViewController = self.navigationController;
[self.window addSubview:self.navigationController.view];
这对于运行3.1.3的iPhone来说确实如此。     

要回复问题请先登录注册