Xcode 4 templates don't work in iOS 3.1.2
I would like to test my app for older phones, and got one with 3.1.2. But when I try to run it, it just show the splash screen and then crash.
Then I tried to make a new Hello World view-based app from Xcode 4 templates, but even with this one it build fine but crash on startup. I set deployment target to 3.1.
If i try to run this one with iPad 3.2 simulator, it also crashes.
Where can the problem be?
When i run开发者_JS百科 it on iOS device, it gives this warnings and then just stop, not really crash:
warning: UUID mismatch detected with the loaded library - on disk is: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1/Symbols/System/Library/Priv
UPDATE: I found that I earlier had made a shortcut from 3.1.2 (7D11) to 3.1.2 in the DeviceSupport folder for some reason. I removed that and now I don't get the warnings anymore. Just a crash ;)
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 captured_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: internal-error: unrecognized shared library breakpoint A problem internal to GDB has been detected, further debugging may prove unreliable.
When i run iPad simulator, it crash on this line in HelloWorldAppDelegate.m: self.window.rootViewController = self.viewController;
with this message: 2011-04-21 11:46:09.006 HelloWorld[5492:207] * -[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x4c11bb0 2011-04-21 11:46:09.007 HelloWorld[5492:207] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x4c11bb0'
UPDATE: This was solved by this:
// self.window.rootViewController = self.viewController;
[self.window addSubview: [self.viewController view]];
Use [window addSubview: [myRootViewController view]];
instead of [window: setRootViewController: myRootViewController];
in your app delegate.
I was having the exact same problem as you, and every app I created from an Xcode 4 template would give me the error you describe. By looking at some of the sample code included with Xcode 4's online documentation, I discovered that it works on an iPhone 3G running 3.1.3 if I replaced
self.window.rootViewController = self.navigationController;
with
[self.window addSubview:self.navigationController.view];
That did it for iPhone running 3.1.3.
精彩评论