Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting irrelevant errors when orientation changes in iOS 7

In my iPad app, I have a table with multiple sections and rows. When I change the orientation from landscape to portrait or from portrait to landscape, I get one of the following errors:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WebScriptObjectPrivate countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x124a15a0'

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DOMHTMLHeadElement rotatingClient]: unrecognized selector sent to instance 0x8c60a20'

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x8f7c380'

I'm not explicitly using any of the classes from which the exceptions are thrown.

EDIT: Using Instruments, I found that this is where the crash happens. I haven't used it before so I'm not sure what to do with it.

#   Event Type  ∆ RefCt RefCt   Timestamp       Responsible Library  Responsible Caller
2   Zombie              -1      00:38.935.631   UIKit                -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:]
like image 902
halileohalilei Avatar asked Jun 20 '14 11:06

halileohalilei


Video Answer


1 Answers

When you get unrecognized selector messages sent to objects of classes you don't use directly, the answer is usually that your target objects have been released unexpectedly and the memory re-used for the objects that appear in the error message.

Your best bet is to turn on zombies in your scheme and see which released objects are being sent messages. Or, you can try to track it down by figuring out what object should be receiving the message and what has happened to it. (Obviously, the first is easier when it's possible.)

like image 176
Phillip Mills Avatar answered Oct 16 '22 06:10

Phillip Mills