Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8614247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:04:38+00:00 2026-06-12T05:04:38+00:00

How can I check when an instance of MPMoviePlayerController is deallocated? Note I already

  • 0

How can I check when an instance of MPMoviePlayerController is deallocated? Note I already have NSZombieEnabled set to YES and checked.

The code in question works great under some circumstances in my app. In another, when the view with the moviePlayer controls is expanded, the MPMoviePlayerDidEnterFullscreenNotification callback method is executed and shortly after the screen goes black and the app from user viewpoint freezes. (The difference is this one has an extra viewController on the navigation stack). It does not crash the app. It is still running but can not return back to a usable UI.

In the debugger, I check the last known time when the instance was “alive” to get its address, to check and find it is deallocated:

2012-10-01 18:35:46.032 MyApp[930:907] -[MyMoviePlayerViewController moviePlayerDidEnterFullscreenNotification:](203): : moviePlayer = <MPMoviePlayerController: 0x1dba9420> loadState = 3
2012-10-01 18:36:05.280 MyApp[930:907] [MPAVController] Autoplay: Enabling autoplay

Black screen occurs here, so I check the debugger:

(lldb) po 0x1dba9420
2012-10-01 18:37:38.656 MyApp[930:907] *** -[MPMoviePlayerController respondsToSelector:]: message sent to deallocated instance 0x1dba9420
(int) $0 = 498766880 [no Objective-C description available]

If I check other known instance of other classes, they are alive and well as expected:

(lldb) po 0x1da12110
(int) $1 = 497099024 <MyDetailViewControllerWithTableView: 0x1da12110>
(lldb) po 0x1da1af70
(int) $2 = 497135472 <MyMasterTableViewController: 0x1da1af70>
(lldb) po 0x1da19be0
(int) $3 = 497130464 <NSFetchedResultsController: 0x1da19be0>

So, to reiterate, how does one check when and by what an instance gets deallocated or destroyed? Is there an Instruments type that can be used.
Allocations shows that instances was allocated and now not alive….

I suppose I can do a fine step by step trace but that is tedious…
Would be great to be able to set a condition when the event occurs and trigger
the Instruments (or debugger) to stop.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:04:39+00:00Added an answer on June 12, 2026 at 5:04 am

    I fixed this. It appears that when the user expands the moviePlayer, the event lifecycle causes the view (MyAddDetailViewController) (that holds the subview (MyMoviePlayerController)) to execute viewWillDisappear & viewDidDisappear.

    I mentioned that the code path created an additional viewController on the navigation stack, and that VC was making a brief appearance (evidenced by a viewWillAppear message) then going back into the background with viewWillDisappear. It still is not clear why that would cause the autoreleasePool to free up MyAddDetailViewController thus deallocating MyMoviePlayerController, but it is now clear that there was no strong reference to MyAddDetailViewController.

    To fix, I created a property in the VC that pushes MyAddDetailViewController onto the navigation Stack to hold a strong reference to it.

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
    // ... snip ...
        self.myAddDetailViewControllerReference = [segue destinationViewController];
    
    }
    
    //
    
    - (void)viewDidUnload {
        [self setMediaAddDetailViewControllerReference:nil];
    
    }
    

    That takes care of the black screen/freeze.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MPMoviePlayerController instance. I wish to check its playbackState property for one
I can check for iPhone with this code: (navigator.userAgent.match(/iPhone/i)) But I want to target
With this code I can check the caret position in a textarea in firefox:
I have a check box list in that user can check or uncheck the
How can I know whether an instance of a class already exists in memory?
How can we check whether the instance is running or terminated? As terminated instance
In Objective-C when you declare an instance variable you can check if it conforms
Is there a way I can check all these values without having to code
IS there a view where i can check whether an instance had been started
Can check out here alt text http://51hired.com/static/problem.bmp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.