Search code examples
iosnotificationsautomatic-ref-countingmpmovieplayercontrollerdealloc

Notification when an object is released by ARC System


I am converting my Huge project to ARC, though success fully converted and I am using it but there are some lines of code still there in dealloc which needs to be called anyway.
Example I was stopping and releasing the MPMoviePlayerController properly when dealloc used to call before ARC or any other notifications needs to be unregistered in dealloc.

Now the problem is I am using dealloc (without [super dealloc]) but it's not getting called, is there any tweak by which I can get the call to dealloc so that I dont have to change the bulk of code.


Solution

  • dealloc normally gets called in an ARC environment. You can verify it for yourself by creating a local variable pointing to a simple object that has a NSLog in its dealloc and then letting it fall out of scope.

    You might want to use Instruments to trace what's holding onto your object.