简体   繁体   中英

Crash application in iPad but not in iPhone

Good morning, I have an application that run well on iPhone but crash to launch in iPad and don't understand the problem.

Crash incident:Hardware Model:      iPad3,3
Process:         SardinianPirates1 [20569]
Path:            /var/mobile/Applications/BD12D72A-B8BC-4443-B866-8B632211A467/nameofapp.app/nameofapp
Identifier:      nameofapp
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-04-11 15:41:24.829 -0700
OS Version:      iPhone OS 5.1 (9B176)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/BD12D72A-B8BC-4443-B866-8B632211A467/nameofapp.app> (loaded)' with name 'MainWindow-iPad''
*** First throw call stack:
(0x31f9e88f 0x367f3259 0x31f9e789 0x31f9e7ab 0x32d9f437 0x32da094d 0x32cd6509 0x32b5f893 0x32b598d7 0x32b27c6b 0x32b2770f 0x32b270e3 0x3595322b 0x31f72523 0x31f724c5 0x31f71313 0x31ef44a5 0x31ef436d 0x32b58a13 0x32b55e7d 0xfbdef 0xfbda8)

This is my Xcode error log when launch the iPad simulator

2012-04-12 07:53:50.556 nameofapp[16337:10a03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/myname/Library/Application Support/iPhone Simulator/5.1/Applications/E8655CDA-1E4F-41CB-B3C7-9A5B7BFF13A6/nameofapp.app> (loaded)' with name 'MainWindow-iPad''
*** First throw call stack:
(0x1c1a022 0x1905cd6 0x1bc2a48 0x1bc29b9 0x5bb638 0x5bceb7 0x399ce1 0x399ff8 0x39917f 0x3a8183 0x3a8c38 0x39c634 0x2312ef5 0x1bee195 0x1b52ff2 0x1b518da 0x1b50d84 0x1b50c9b 0x398c65 0x39a626 0x25a7 0x2541 0x1)
terminate called throwing an exception(lldb) 

Any idea for help me? Thank you

It's saying that it expects to find a file called MainWindow-iPad in your application bundle. Look in your Target settings under Summary , iPad Deployment Info . As Radrider33 says, this may also be requested by your app delegate.

There are three different ways you can choose to fix this:

  1. If your app UI is precisely designed for the iPhone screen size, go to Summary , iOS Application Target and set Devices to iPhone . On the iPad, your app will run in an iPhone-shaped window, with the usual 2x button. This is the least work, but has the ugliest results.
  2. If your iPhone UI makes good use of autosizing masks, you can set the iPad Main Interface or Main Storyboard filename to match the iPhone / iPod version. Everything view will be fitted to the larger iPad screen based on its masks.
  3. If you want to redesign your UI for the iPad (most work, but Apple would rather you do this), create an appropriate set of files in Interface Builder. Either name the window MainWindow-iPad , or change the iPad Main Interface file to match whatever file you create.

Change your project's default window settings. and also check your ios version of ipad

Check your project settings. Your app is trying to loan an xib with file name " MainWindow-iPad" and cannot. Be sure that everything is correct in both your app delegate as well as your project's default window settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM