iOS - mysterious SIGABRT - xcode6

I'm getting a SIGABRT - any suggestions how I catch it?
The only clues I have so far are:
the Exception breakpoint (How to track down cause of SIGABRT) does not seem to be catching it
it only crashes on the iPhone 4 device running iOS7 and not on the iPhone 4s simulator or the iPhone 6 device.
Here's my (pretty useless) stack trace:
UPDATE
A longer (but no less useless) stack trace:

Look in the console log. It will provide some info on the error which caused sigabrt. Also be sure to check your outlet and action connections. You may have deleted a outlet after you linked it up and that way xcode can't find that missing outlet you deleted.

SIGABRT occurs when you accidentally/intentionally change connections of an outlet or an action.
According to you, you deleted a connection by merely deleting it from the code but under the hood, it still exists.
So, what you can do is, click on the attribute which is giving the sigabrt and then click on the connections inspector on the right side of the Xcode.
If you see any stray connections, just delete it. This is how you actually delete a connection.
Hope this helps.

Related

iTunes Connect Crash Report - UINibDecoderDecodeObjectForValue

I have a crash report on iOS 5.1 that is caused by UINibDecoderDecodeObjectForValue. To my understanding this generally is due to a value being set improperly in a nib (generally something has been deleted). The crash report gives me two problems:
From the crash report itself I cannot see to figure out which nib is causing the crash. However I have had some review stating that the crash happens on a setting screen for some users so that is the one I am focusing on.
Assuming it is the Settings view, its simply a UIViewController with a table view. It has the UITableViewDelegate and UITableViewDataSource. To my knowledge everything is setup correctly.
So my questions would be:
How can I confirm what nib is causing the error?
Is there anyway I can have XCode give me warning about anything that may be wrong with my nibs?
Stacktrace from the crash report is here.
it would really help if you post the exception you got.
check for IBOutlets, something might be missing or set wrong (IB is not known for it's best integration with XCode)
check for deprecated UI elements which are inside your nib (again, IB is not known for it's compatibility with the target SDK).
Good luck!
The problem was with iOS auto layout. Similar to the issue found here:
presentViewController: crash on iOS <6 (AutoLayout)

"Multiple locks on web thread" error thrown inconsistently

I'm getting a strange error in my iOS app. The error message is as follows:
bool _WebTryThreadLock(bool), 0x22c820: Multiple locks on web thread not allowed! Please file a bug. Crashing now...
The odd thing is that it happens inconsistently -- sometimes clicking a certain button or textField will cause the crash, and other times the same steps won't cause a crash. I originally had a few UIWebViews in one viewController, but I've commented out everything related to them, so as far as I know, I'm not accessing the web thread at all. Even when I did have these UIWebViews in my project, the error often occurred in viewControllers unrelated to the webView. I also got the error once when my app was open on the device and I received an email. The push notification from the email seemed related. Any ideas what might be causing this?
I am suspicious that this might be related to the way we are currently segueing between viewControllers. We are using modal segues and manually dismissing one viewController upon loading another. Is that a bad idea?
Any input would be greatly appreciated.

Facebook Connect Login Dialog crashing app

Of the many problems I've been having with my current app, this is one of the most annoying.
In the simulator the login dialog works fine, however on a device it's just a frozen white box and the console prints the following:
void SendDelegateMessage(NSInvocation*): delegate
(webView:resource:willSendRequest:redirectResponse:fromDataSource:)
failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
I've looked this up but I'm still not sure what it means.
If I try switching
[self authorizeWithFBAppAuth:NO safariAuth:NO];
to
[self authorizeWithFBAppAuth:NO safariAuth:YES];
it switches to the safari app to verify but this somehow kills my app with an error which says ReturnNotPermittedKillClient.
Has anyone experienced a similar problem? On my last app it just worked without any of these issues, and as far as I can see I've done everything the same way this time. However this project was inherited from someone else so there may be underlying causes that I am not aware of.
Edit: Just tried moving the login request from didFinishLaunchingWithOptions to a point in the intro screen class where everything else has already been loaded, just in case it was a memory issue caused by too many tasks trying to run at the same time. This time the error message didn't appear, however the login box still remained white and then closed the app a few seconds later.
Edit2: Seems like it's simply a memory error. I changed all variables which I had previously released to be retained, which has fixed the problem on my 3GS. However on my iPad 1 the problem persists. Incidentally, when changing shouldAutorotateToInterfaceOrientation from using landscaperight to using landscaperight or landscapeleft, when I rotate the iPad I get a memory warning and then the same crash. In both cases there are no debug error messages other than the memory warning, and the app just closes down - there is no breakpoint etc to see where the issue lies.
if you are using the webview then we need to do this first b4 moving to next view .delegate = nil;
This might be what you want:
There are other branches of this in NSObject in the documentation.
Code:
[self performSelector: withObject: afterDelay: ]
The problem was simply down to memory. After changing the way it loads images, sounds etc the problem has gone away.

unrecognized selector sent to instance on deviceOrientationDidChange

Right now my app should only supports Portrait. On Summary/Supported Device Orientations I have only selected Portrait so I'm hoping that my app will not rotate. I was testing the app on a device and suddenly I'm getting the following error randomly:
[UIButtonContent deviceOrientationDidChange:]: unrecognized selector sent to instance
It happens when I rotate the device SOMETIMES, is not consistent, and is not always over UIBUttonContent. I supposed that if I only select Portrait, deviceOrientationDidChange should not be called or should be ignored.
Other times my app crashes with an EXC_BAD_ACCESS (code=1, address=something) but it happens when I rotate the device so I'm guessing that both errors are related.
I don't know what to do with this, it's hard to debug because I don't have feedback, the All Exceptions Breakpoint is not being called, so I don't know where and exactly why this is happening. Any idea on how to debug this is welcome.
These are the classic signs of a memory management error. You have over-released some object and it has been deallocated while something else still references it. Later, something messages it. In some cases a new object has taken its place, but that object doesn't understand the messages it's receiving. In other cases, there's no valid object and you get a crash.
Edited to second the advice to use the Zombies instrument to find the over-release.
Do you have a class that should be called with deviceOrientationDidChange:? When this happens, it usually means that you have a dangling reference to a deallocated object. You should try profiling your app with Instruments in "Zombies" mode.
I solved this issue a long time ago, but I think is good to share what actually helped me on this case.
After trying everything with no results with Instruments I started debugging old-school. I had an idea of "where" the error was so I just commented all the code on that section. I was right, the bug just disappeared along with some functionalities. After that I made "binary uncommenting" (uncomment one half) till I got the bug line. It was a third party library, I had an object that was not being released properly.

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.