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 8860349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:14:57+00:00 2026-06-14T15:14:57+00:00

This is my first time posting and I am stuck on what is sure

  • 0

This is my first time posting and I am stuck on what is sure to be an easy question. I am using a framework that causes snow to fall over a UIImage that is chosen by the user. Here is the code that creates an instance of the snowfalling class:

- (void)viewDidAppear:(BOOL)animated
{

    // Animate
     SnowFalling *snowfalling = [[SnowFalling alloc]
                            initWithView:self.view];
     snowfalling.hidden = NO;
     snowfalling.numbersOfFlake = 175;
     [snowfalling startAnimating];

}

After this, I want to pop back to the previous view using a custom back button:

// Custom back button on toolbar.
- (IBAction)backButton:(UIBarButtonItem *)sender {
  [[self navigationController] popViewControllerAnimated:YES];
}

This works fine accept that when I hit the back button, the app crashes with a zombie that says: “[uiview frame] message sent to deallocated object”

If I place:

  [snowfalling stopanimating];

in the snowfalling instance, than the current view controller just has the snow frozen on the screen. But it will let me pop to the previous controller with no issue.

My question then is, how do I stop the animation when the back button (popViewControllerAnimated:YES) is hit?

  • 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-14T15:14:58+00:00Added an answer on June 14, 2026 at 3:14 pm
    1. In you controller class create a property to hold the value of snowfalling:

      @property(nonatomic,retain) SnowFalling *snowfalling; // in @interface
      
      @synthesize snowfalling; // in @implementation
      
    2. In your viewDidAppear: assign the newly created SnowFalling to that property instead of the local variable.

    3. Remember to [release] SnowFalling right after assigning it to the property. The whole method should look like this:

      - (void)viewDidAppear:(BOOL)animated
      {    
          // Animate
           self.snowfalling = [[SnowFalling alloc]
                              initWithView:self.view];
           [self.snowfalling release];
           self.snowfalling.hidden = NO;
           self.snowfalling.numbersOfFlake = 175;
           [self.snowfalling startAnimating];
      }
      
    4. In [backButton:] call

       [self.snowfalling stopanimating];
       self.snowfalling = nil;
      

    before calling popViewControllerAnimated. Better yet, place these two lines in [viewWillDisappear:], that way they will always get invoked.

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

Sidebar

Related Questions

this is my first time posting here, I have a question which I have
That's my first time posting on stackoverflow. I've been finding usefull answers on this
This is my first time posting a question here, it has been a valuable
this is my first time ever posting a question and I am kind of
First time posting a question on StackOverflow, so please go easy on me :)
this is my first time posting a question here - I've searched for ones
This is my first time posting here. I am using GUI in java for
This is my first time posting a question to the forum, by the way.
This is my first time posting a question on this site, but certainly not
this is my first time posting on StackOverflow but this site is awesome. Thanks

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.