Message sent to deallocated instance in swift - ios

I'm getting an error that causes the app to crash. My application having list of the videos(My application screen divided in two part, one for player and second for videos list). I am using AVPlayerViewController for play the video. If user clicks continuously two item that the app to crash.
I have tried to run using NSZombie and I get the following message :
An Objective-C message was sent to a deallocated 'FigPlaybackItem'
object (zombie) at address: 0x14734ed00.
Do you have any idea of how to solve this issue?
Here is the output from Allocation instrument with NSZombies Detection if it helps:

Related

An Objective-C message was sent to a deallocated 'UIActivityIndicatorView' object

When running my app on device, it crashes right when I initiate my AvPlayer to stream an mp3. However, it works fine on simulator.
I have tried to run it through Zombie and I get the following error message when it crashes : "An Objective-C message was sent to a deallocated 'UIActivityIndicatorView' object (zombie) at address: 0x108c020e0"
I am using an Activity indicator in previous scenes but I have tried to remove it completely, leaving no line of code mentioning any UIActivityIndicatorView and I still get the same error.
Any idea of how to deal with this? Can it be linked to the system activity indicator displayed the status bar?
Many thanks for your help
It's a crash because of abusing appearance API not as documenting (setting a property not marked with UI_APPEARANCE_SELECTOR).
For reference, see here.

Box iOS SDK Issue: [BoxAPIMultipartToJSONOperation respondsToSelector:]: message sent to deallocated instance 0x1707a32c0

I get this error from the box sdk when I try to upload a file. It never occurs on the first upload. Always on the second upload. (I upload 25 files, I upload 25 again and this memory error pops up)
I tracked the problem down to box code with NSZombies. Basically the NSStream Delegate in the "BoxAPIMultiPartToJSONOperation.m" file is sending a message/calling a method on the object at this address after it gets deallocated.
My guess is that it's this line [self performSelector:#selector(retryWrite:) withObject:theStream afterDelay:0.1];
There was a github issue about this a while ago: https://github.com/box/box-ios-sdk-v2/issues/76
The issue there was that the NSStream delegate was calling a method on something after it was supposed to be cancelled. Was resolved by making sure to shut off the stream once the thing finished.
My latest idea is to try and kill the Box API threads (yeah I'm that desperate.)
If anyone has faced this specific issue I'd love to hear how you resolved it.
Thanks.

[NSISUnrestrictedVariable retain]: message sent to deallocated instance

I am at a complete lose here. I get this error when the page finishes loading and it only happens on the ipad. This error started happening with ios 7. How can i get the stacktrace for this memory address.

NSInvalidArgument Exception - Random Objects Receiving didEnterBackground

Every time a user taps the home button while my app is active, I am getting the following exception. Slight caveat - The example exception below references NSCFString. However, the type of object that gets sent this message, and thus causes the exception is totally random. It could be an NSData or an OS_dispatch_queue_specific_queue.
[__NSCFString didEnterBackground:]: unrecognized selector sent to
instance 0x155344c0 * Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFString
didEnterBackground:]: unrecognized selector sent to instance
0x155344c0
Happens every single time the app is resigned active, but the object receiving the message is never the same.
I assume this is some sort of memory issue but am having trouble tracking it down. Mostly because nothing in my code ever directly sends/receives this message, or is registered to receive the UIApplicationWillResignActiveNotification. Also, there is nothing in my appDelegate for the applicationDidEnterBackground:application method.
Has anyone ever seen this type of behavior? And if so, what is the best way to debug? Or maybe another way, what sorts of objects would be automatically sent the didEnterBackground message that I am clearly mismanaging?
It sounds like you have a zombie.
A zombie is an object that gets called after it is deallocated. Often, the memory address of the object is then used for another object, so the message goes to the wrong object.
Do you have code that registers one of your application objects for a "did enter background" notification (UIApplicationDidEnterBackgroundNotification) using the method addObserver:selector:name:object:? And does that notification specify a selector of "didEnterBackground:?"
My guess is that you're registering for UIApplicationDidEnterBackgroundNotification notifications, and then the notificationObserver you're specifying is being deallocated. That would cause the exact behavior you are describing.
BTW, you might want to run your app using the zombies instrument, or turn on the NSZombies environment variable to look for zombies. Then press the home button to cause the crash and see what Xcode/instruments tells you.

iOS app crashing because of FlurryAds

I am experiencing a hard to debug problem. My program crashes because a message is sent to a deallocated object. Using Zombie Objects, I have found out what is causing it to crash, but don't know how to fix it. When my view dissappears, I set the FlurryAds delegate to nil, and upon that view appearing I set it to the view. When I background my app and am in this view, I immediately get a crash. Is there a bug in Flurry?
This is the message printed to the console:
2013-01-18 14:04:44.626 Purdue Course Sniper[19212:c07] *** -[FlurryAd space]: message sent to deallocated instance 0xa6ac490
I am not sending this message anywhere ^^. Why is this message being sent anyways? The delegate is set to nil..
I work for Flurry and I will be happy to help. I need to understand a little more about your integration. Namely, more about this statement "When my view dissappears, I set the FlurryAds delegate to nil, and upon that view appearing I set it to the view". What view is disappearing and appearing? Is this a fullscreen ad? It would also help to know details of your account with Flurry. Can you send an email to support#flurry.com so we can access your account? Thanks and sorry you are experiencing an issue.
(Full disclosure: I work in the Support team at Flurry)

Resources