views:

4936

answers:

5

I've just finished off an app for the iPhone which, until today, ran fine on the iPhone simulator and actual devices.

I tried changing the xib which is loaded in the applicationDidFinishLaunching method in my application delegate class - all I did was change the string in initWithNibName.

When I launch the app on the simulator, the Default.png image is shown, then the app crashes with an uncaught exception. When running on a device, the Default.png image is shown for about 10 seconds, the UI is never loaded and I get 'GDB: Program received signal: "SIGABRT".' on the Xcode status bar. Debugging shows that applicationDidFinishLaunching is never actually reached before the app crashes.

Setting the starting xib back to the original solves the issue, but now I've made a change and saved it in the Interface Builder and the app shows the same issues as above - I've made no code changes at all.

Is this a memory issue, or a known issue of a common mistake?

NOTE: I've made no code changes whatsoever, and the only changes I've made to the xib are cosmetic, the IBOutlets are all intact.

A: 

is the linking in the new XIB compatible? can you post the full dump?

Mobs
Can you point me towards the exact thing you're looking for? I'm relatively new to Xcode. This is what I get from the console: http://pastebin.com/m4976167
Boz
Yes, this is definitely due to the "connections" in IB referencing IBOutlets in your code that don't exist.
Mobs
I've checked the IBOutlets, broken them and recreated them - still exactly the same issue. I'm concerned that the line to load the xib is never actually reached; are nib files handled before this at runtime?
Boz
A: 

You probably changed an IBOutlet's name in code without changing it in the xib.

Nikolai Ruhe
I've checked the two IBOutlets in the main xib and the connections seem fine, as they were before - please note, I never reach applicationDidFinishLaunching before the crash, so the xib isn't actually loaded, right?
Boz
It's not clear if you're talking about the main nib loaded from `UIApplicationMain` or another one loaded from code.
Nikolai Ruhe
I'm talking about the nib loaded from the applicationDidFinishLaunching method in the app delegate. However, the method is never reached in the debugger before the app crashes.
Boz
Of course, code that is not executed cannot crash. Double check the automatically loaded nib from `UIApplicationMain`.
Nikolai Ruhe
A: 

You probably had IBOutlets connected from a xib back into your code, and those connections are broken.

You'll have to give us a little more detail on how the nibname string was changed. Did you rename your xib file?

mahboudz
The changes I made were purely cosmetic, mainly to see whether I could recreate the issue without changing any code - I think the problem is not in the code, because the app ran fine last night with the same code. All I've done is changed the colour of a label and saved the xib under the same name.
Boz
A: 

Sorry guys, my fault - it appears I deleted the MainWindow.xib file, so the delegate wasn't called on startup after I made changes. I've recreated it and linked it to the app delegate and UIApplication so now everything works.

Boz
A: 

i get the same error and have not deleted anything. The build succeeds and the default.png file loads and then just sits there and I get the error code of GDB: SIGABRT. Can someone tell me what GDB stands for so that I can start somewhere. I originally had this build on 3.1.3 and then rebuilt it on the 4.0 OS. It works for me on 3.1.3 but not on 4.0. Wonder if my code is not the same on 4.0?

Nick