Receiving "Thread 1: signal SIGABRT" after I add a new View Controller. How can I resolve this? - objective-c

My project built and ran completely fine. (it's rootViewController is a TabBarController) So I added two new view controller to my storyboard and connected them to my rootviewcontroller. In storyboard, the tabs were added just fine and everything looked okay. So I added the ViewController classes to my project and hooked them up to the correct viewControllers in storyboard. However, when I ran the project my new tabs were not visible in the simulator. So I ran "clean" on my project, deleted my application out of the simulator, reset the simulator to its original settings, and my new tabs still would not appear in the simulator. So i quit everything and restarted my mac. This time, when I ran my project it gave me the "Thread 1:signal SIGABRT" So i became frustrated and deleted my new viewControllers, both from the storyboard and the classes menu. I sent the classes to trash. But STILL I get the SIGABRT error. Even now that I am back to my original project, I am getting the error. I can't figure out what is wrong. Since it won't let me post a picture of my screen, just let me know if you need any additional debugger output or anything.
this is what its giving me in the debugger.
2012-07-05 09:22:33.336 NewsomeBand[265:15203] ***
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: 'Could not
find a storyboard named 'MainStoryboard' in bundle
NSBundle </Users/tammyscheele/Library/Application
Support/iPhone Simulator/5.1/Applications/
1B3E088D-23A6-4B77-8CBB-390A9720818A/
NewsomeBand.app> (loaded)'
*** First throw call stack:
(0x152b022 0x30d2cd6 0x5179f2 0xecd60 0xecff8 0xec17f 0xfb183 0xfbc38 0xef634
0x16beef5 0x14ff195 0x1463ff2 0x14628da 0x1461d84 0x1461c9b
0xebc65 0xed626 0x202d 0x1f95)
terminate called throwing an exception(lldb)

From the debugger output that you posted it looks like you may have accidentally also deleted a reference to your main/root story board. I'm guessing this based on
'NSInvalidArgumentException', reason: 'Could not
find a storyboard named 'MainStoryboard' in bundle
Either that or did you accidentally rename it somewhere or misspell it? It looks like its something simple in any case.

I solved it! I went into the info tab inside my project and set "Main storyboard file base name" to "MainStoryboard", and also made sure that my storyboard was named "MainStoryboard". That seemed to fix everything

Related

TableView crashes when swiped beyond start

One of my TableViews crashes when a swipe downwards would tend to scroll it to earlier than its start. The error is
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[kitios.VersesTableViewController refreshVerseItems:]: unrecognized selector sent to instance 0x105155780'
kitios is the name of my app, VersesTableViewController is the custom class for the TableView controller, but my code does not have any function named refreshVerseItems. This is extremely puzzling!
What should I be looking for?
Months ago when learning how to cope with adding a row into the TableView I tried using a value changed event; but found a better way, deleted the #IBAction refreshVerseItems() function from the Swift code, but forgot to delete the valued changed action from the storyboard. Forgetting to remove that bit from the storyboard "came back to haunt me"! Problem is now fixed.

NSInvalidUnarchiveOperationException: Could not instantiate class named NSLayoutConstraint

I am very new to this. I followed Apple's tutorial step by step for the iPhone project "HelloWorld". I ran it in the iPhone 5.0 simulator and it crashed:
2012-11-02 14:46:06.782 HelloWorld[9880:c07] * Terminating app due
to uncaught
exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate
class named NSLayoutConstraint'
* First throw call stack:
(0x14a2052 0xea2d0a 0x144aa78 0x144a9e9 0x32f7d7 0x32f9af 0x32f6b7 0x23036d 0xd7e2c 0xd83a9 0xd85cb 0x38a73 0x38ce2 0x38ea8 0x3fd9a
0x10be6 0x118a6 0x20743 0x211f8 0x14aa9 0x138cfa9 0x14761c5 0x13db022
0x13d990a 0x13d8db4 0x13d8ccb 0x112a7 0x12a9b 0x1fed 0x1f15 0x1)
terminate called throwing an exception(lldb)
Can someone please tell me what went wrong? I'm using Xcode 4.5.
By default, when you create a new iOS project in Xcode 4.5, your storyboard or XIB is set to use Autolayout, which is a new feature in iOS 6.0. The NSLayoutConstraint class is part of the Autolayout system, and it doesn't exist in older versions of iOS.
If you want to deploy your app to an older version of iOS, you need to change your storyboard or XIB to not use Autolayout. It's a checkbox in the File Inspector:
Your Xib file (Interface builder file) contains AutoLayout elements, which iOS 5 does not support.
In Xcode, go to your .xib file(s), and for each one, turn off AutoLayout. There should be a checkbox on the left hand side saying "Use AutoLayout", uncheck it and try again. (This is under the first tab in the left hand side inspector, when you have File's owner) selected.
I stumbled into this error when I was working on an older project I wanted to update. I had selected the "Use Autolayout" checkbox to start working with constraints, but had forgotten to update my Deployment Target setting to iOS 6.
You need to run it in iPhone 6.0 simulator. Your error:
* Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint' *
Suggests that you are using autolayout, which only works on iOS 6.

iOS6: UIViewController was unable to load nib named

When testing in the iOS6 simulator, I am getting the following error when clicking a disclosure indicator:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "LocationDetail"'
It runs perfectly fine in iOS5.
I do NOT have the LocationDetail nib anymore, nor need to use it. I have looked in my entire project for references to it, as well as in my MainWindow nib and all connections looking to see where it could be used, but I find none.
How would XCode still be wanting to load this, and why only the errors in iOS6?
The problem is not in Xcode, but in the iOS Simulator. If you've removed all references to the .xib in your project, and cleaned everything as you described, the problem is that the .xib file still exists in the app bundle in the Simulator. You should try deleting the app from the Simulator (or better yet, Reset All Content & Settings on the Simulator). This will fix it.
what i know is that initWithStyle:UITableViewStyleGrouped will call the initWithNibName:Bundle: method...
your class had the same name as your nib file, so when you called the initWithStyle:UITableViewStyleGrouped it tried to load that nib file.
when you renamed your class, it didn't find an nib with the same class name so no errors showed up as before.
I decided to just rename my class and .h and .m files and that fixed the issue.
Who knows why.

presentViewController: crash on iOS <6 (AutoLayout)

This is a weird crash I am getting. The crash happens when I press a button that goes to a certain ViewController. The line which it crashes on is:
DestinationInformationViewController *info = [[DestinationInformationViewController alloc] init];
[info setModalTransitionStyle: UIModalTransitionStyleCrossDissolve];
[self presentViewController:info animated:YES completion: nil]; // CRASHES HERE
[info release];
The crash trace is:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x3758288f 0x35287259 0x37582789 0x375827ab 0x3153d54d 0x3153d6bb 0x3153d423 0x314ce001 0x3143c3c7 0x31319c59 0x3128fc17 0x3129a267 0x3129a1d5 0x3133959b 0x31338367 0x84091 0x374dc3fd 0x31271e07 0x31271dc3 0x31271da1 0x31271b11 0x31272449 0x3127092b 0x31270319 0x31256695 0x31255f3b 0x33c9822b 0x37556523 0x375564c5 0x37555313 0x374d84a5 0x374d836d 0x33c97439 0x31284cd5 0x82bb3 0x71200)
terminate called throwing an exception(gdb) Could not instantiate class named NSLayoutConstraint
NOTE: This crashes on my iPhone 4 iOS 5.1 but not on my iPhone 4S iOS 6 Beta 2
I believe this is an issue with Xcode's new interface builder. Did you happen to build your .xib using Xcode 4.5's interface builder? I've run into this same problem just now, and I think that's the problem. My app runs on iOS 6, but not anything older.
And you need to make sure you turn off Use Auto Layout for your xibs.
That can be done by:
Open your xib.
Go to the File Inspector tab.
Find the Interface Builder Document section on the right toolbar.
Uncheck the Use Auto Layout option.
I had the same problem when I downloaded new XCode update and IOS6 SDK. Here's how I solved it:
Select the Interface builder file (whether xib or storyboard file) where your error occurs.
In assistant editor on the right in XCode, select the first tab from the left, and there is a checkbox for option "Use Autolayout" like on the screenshot above.
Uncheck the checkbox.
Nagaraja asks "How to resolve the same if we are not using xib? I ran into exactly this problem. I created a controller with a xib, and then I decided to remove the xib file. The crash did not go away. The problem was that I needed to implement
- (void) loadView
in my controller class. Once I implemented this method the problem got solved.
Another possible reason for a crash with presentViewController is having something in the nib connected to a variable that is no longer there - the variable either having it's name changed or it was deleted.

Crash upon text selection and deletion from menu in UITextView

My UITextViews crash the app upon text selection and deletion.
Cut, copy, and paste seem to work fine. The only error in the log is:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIMenuController view]: unrecognized selector sent to instance 0xff85ac0'
It is a normal UITextView, and the UIMenuController is untouched and uncustomized. Any ideas?
Happens with iOS 4.3 and 5.0 in simulator and on device.
No more information with zombies enabled, except for a stack trace that I'll need to interpret.. The new Xcode isn't nice about this:
(0x356338bf 0x360ae1e5 0x35636acb 0x35635945 0x35590680 0x37c63925 0x3816b 0x1a557 0x3559222b 0x37a869a7 0x3559222b 0x31671943 0x35607a63 0x356076c9 0x3560629f 0x355894dd 0x355893a5 0x32073fed 0x3794d743 0x29d1 0x2990)
The cause was undocumented (correct me if you find documentation and I'll update this answer) behavior from UITextView and UITextField with their default use of UIMenuController. The "Delete" option is added if your UIText*Delegate implements delete:. When "Delete" is selected from the menu, your field's delegate will then be called with a delete: message. I discovered this by adding an exception breakpoint in the breakpoint listing pane, which gave me the properly symbolicated stack trace that the original exception did not. The crash was caused because I was using delete:(id)sender to service bar button items in a way that required use of the sender. I fixed it by renaming delete: to deletePart:. The user can still delete text by selecting "Cut".
Having view sent to UIMenuController means that you probably assigned the UIMenuController somewhere it shouldn't go. See if you set anything to equal menuController (or whatever your instance variable name is) and see if that causes an issue.
Also, this could be an overrelease happening much earlier in the code where the UIMenuController just happens to allocate in the memory space that was formerly occupied by something that was released too early. Enable NSZombies and see what your error changes to.