How to identify crash from XIB - ios

I don't have any code implemented in view controller to set the font or attributedLabel. But I'm seeing crash with below reason.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: -[_SwiftValue pointSize]: unrecognized selector sent to instance 0x610001040ba0

There is another way of debugging issue. When app is crashed, check left panel and you will observe threads stack. In that find out Obj_exception_throw select that and use your logging area to run command po $arg1. This may give you the correct reason for crashing.
Or else, you can try using Application Unit tests for verifying all your IBOutlets and objects, loaded from NIBs.

You can select that xib and open it as source code.
Or search tho whole project to find that.

Related

Xcode error on running app with embedded framework

I am trying to create framework of my existing app which can be added to any other app as a module. In previous version of the app, i don't have any issues creating the framework and adding it to a demo app to test if it works. With newer version of the app, i am having an issue:
2017-04-21 13:59:02.238333-0400 XXX[8320:3762763] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x1868c2fd8 0x185324538 0x1867a4888 0x1010c3948 0x18c9f1f9c 0x18ca09a28 0x18cb8e2a0 0x18caa8c4c 0x18caa88b4 0x18caa8818 0x18c9ef158 0x189bdf274 0x189bd3de8 0x189bd3ca8 0x189b4f360 0x189b763c0 0x189b76e8c 0x1868709a0 0x18686e628 0x18686ea74 0x18679ed94 0x188208074 0x18ca57130 0x100084860 0x1857ad59c)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any suggestions how to trace back the error inside the embedded framework?
It is happening only with the main View Controllers of the app, not on any off the second level View Controllers which are accessed from these main View Controllers.
I went through the code of the old version and the new version of the embedded framework, i don't see anything major to be different, checked Line by Line the whole code.
Any suggestions?
Thank you codealchimist for the solution, i figure out what i was missing in order to be able to debug it. The solution provided by him solves the problem to be able to debug the app & framework.

Typing in any Text Field crashes app

For some reason whenever I add a text field to my project and try type in it, the app crashes.
The errors I get are:
Can't find keyplane that supports type 4 for keyboard iPhone-PortraitChoco-NumberPad; using 1336863583_PortraitChoco_iPhone-Simple-Pad_Default
-[NSNull length]: unrecognized selector sent to instance 0x1018b1d80
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x1018b1d80'
This happens in both the simulator and on device. I have unchecked "Connect Hardware Keyboard" in the simulator settings also.
Do I have to handle each and every input?
So I saw a solution deep in a forum, and it did actually solve the issue.
For some reason the tab bar controller I was using was causing the issue. Simply deleting the controller, and then going Editor > Embed In > Tab Bar Controller and re adding the views fixed it.

Unreproducible crash: [__NSArrayI enumerateObjectsUsingBlock:]: unrecognized selector sent to instance

I keep getting crash reports with the following crash:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI enumerateObjectsUsingBlock:]: unrecognized selector sent to instance
What could be triggering this crash? An empty array or something that is not an array at all? I am not able to reproduce the crash myself, I just can see it in crash logs.
You most likely have a memory issue, the fact that you can't regularly reproduce it also suggests a memory issue.
The error you are getting is saying, "we tried to call this method on this object you have a pointer to, unfortunately the object is not the type of object you told me it was going to be."
I can really only speculate given the information you've provided. Take a really fine tooth comb through your code and make sure you are not changing that object prior to that crash happening.
Try adding a debug check to make sure its the correct class. NSAsserts are NOT the solution, they are not even compiled into production apps but, it should help find the cause of the error.
NSAssert([myObject isKindOfClass:[NSArray class]], #"aw snap its not an array!");
Post more info and I can try to help further

Adwhirl crashes on while iAd is loading

I have implemented the AdWhirl to show different network Ads but while it shows the ads on my view and I tap to open the ad it crashes with the following displayed in the log
-[AdWhirlAdapterIAd helperNotifyDelegateOfFullScreenModal]: unrecognized selector sent to instance 0x9fce850 2012-12-08
19:40:27.571 ExerMemosApp[2294:1b203] * Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason:
'-[AdWhirlAdapterIAd helperNotifyDelegateOfFullScreenModal]:
unrecognized selector sent to instance 0x9fce850'
I searched too much but couldn't find solution. Give me suggestion to remove this error.
Thanks in advance
Are you sure that the AdWhirlAdNetworkAdapter+Helpers.h file is included in your project? Make sure everything under AdWhirl/Internal is correctly referenced in your build settings.
you are not having helperNotifyDelegateOfFullScreenModal method in your File. Check that one because the name says, its delegate method. you might forgot to implement that method

iOS – Weird exception

I'm getting a strange exception in Xcode 4.2.1 (ARC-enabled project) that I can't track down to the root of the problem.
This is what the exception looks like:
2012-03-18 22:19:32.855 Project[14225:707] +[UIPickerTableViewTitledCell isEqualToString:]: unrecognized selector sent to class 0x3f2bbec4
2012-03-18 22:19:32.859 Project[14225:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIPickerTableViewTitledCell isEqualToString:]: unrecognized selector sent to class 0x3f2bbec4'
What is a UIPickerTableViewTitledCell? I suppose it is some internal class for the UIPickerView to use. But I'm not referencing that class anywhere in my project.
My application is setup as a Tab Bar application with a navigation controller in each tab and this particular tab has a tableview and pickerview.
It sounds like you have an over-released object. I get that when in pre-ARC code, release is called one too many times. The code sounds like it is looking for an NSString to send isEqualToString: to but instead of getting the NSString which has been released already, it gets this random instance of UIPickerTableViewTitledCell.
I would enable Zombies. In Xcode 4.2.1, you can find it in the menu item Product > Edit Scheme. Go to the Diagnostics tab. Then there is an Enable Zombie Objects checkbox. This will make your over-released object into a Zombie, so you can figure out exactly what object is causing your crash.
I would read the Apple doc Technical Note TN2239: iOS Debugging Magic for more in-depth information on this. The whole doc is great, but you can start off by reading the sections titled "Zombies!" and "More Zombies!"

Resources