[UIImageView _isChargeEnabled]: message sent to deallocated instance - cocoa-touch

I am getting this error message from an apparently private API. Anyone have a clue what this could be? It seems to occur, if you use MPMoviePlayerViewController and do a pinch while the movie is running. This will close the player, but afterwards the app crashes.
Only seems to be a problem with certain version of iOS (in this case iOS 3.2.2 on an iPad).
I found one post in another forum, but that did not really help, as with MPMoviePlayerController a different problem occurs.

FWIW, the issue is not the private API, it's that you've got a zombie object.

Related

UITextField do not post notifications

If I set textField.delegate textField stops to post any notifications. Is this expected behavior or is this a bug? I'm targeting to iOS 7.
After a lot of research I can confirm that most of the time using the delegate is not prevent posting notifications.
At this one time it did, but I can't figure out why.

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.