iOS – Weird exception - ios

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!"

Related

How to identify crash from XIB

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.

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

Getting an error from the Stanford iOS Class, but my code seems identical

I believe I did what the instructor did verbatim, but my app (it's a simple app) won't work and errors out if I press a button.
I click run, and it builds, but when I click a button in the iOS simulator the app crashes and brings me back to Xcode with an error.
I don't know what I did wrong. It brings me to the main.m file when we didn't even deal with that in the Stanford guide (maybe it has to do with the fact that the Stanford guide uses iOS 5.0 and I'm on 5.1?).
Here's the project if anyone wants to take a lot at it. I'm just really confused.
http://cl.ly/212A3q3J1m1F1y3A041A
(Also, did I just need to include the xcodeproject file, or was I right in including the whole project folder in a zip file?)
It looks like you have your buttons linked to a selector called digitedPressed:
They also appear to correctly be linked to digitPressed. Just remove the references to digitedPressed. (Right click the Calculator View Controller in your storyboard)
Don't forget to check the XCode debugger! This is the error the XCode debugger showed me:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CalculatorViewController digitedPressed:]: unrecognized selector sent to instance 0x9129cc0'

Resources