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

  • Home
  • SEARCH
  • 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 1003821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:02:08+00:00 2026-05-16T08:02:08+00:00

Ok heres the situation. I have a View controller class that serves as the

  • 0

Ok heres the situation. I have a View controller class that serves as the main view(MainView). It contains a subview that another view controller takes care of(ChangingView). Now, every four seconds, ChangingView needs to change its view. What I am currently doing goes something like this.

ChangingView = [[AnotherView alloc] initWithNibName:@"AnotherView" bundle:[NSBundle mainBundle]];
[MainView addSubview:ChangingView.view]; 

Now, after the 4 seconds is up and before the lines up there are called I do the following.

[ChangingView release];
[ChangingView.view removeFromSuperview];

What is happening is I am getting memory warnings like mad. And eventually it gives me the debug messages of “program sent ‘0’” or “data formatters currently unavailable”. Both of which I believe mean I am out of memory. I don’t think that should be happening as the amount of stuff in the views isn’t multiple MB so for some reason it has to be stacking or something. If you need any clarification please ask and any help will be greatly appreciated as I am currently stumped. Thanks in advance.

  • 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-05-16T08:02:09+00:00Added an answer on May 16, 2026 at 8:02 am

    Something irks me about these two lines of code:

    [ChangingView release];
    [ChangingView.view removeFromSuperview];
    

    I think that the very fact that you can actually access ChangingView.view after you’ve released without getting an EXC_BAD_ACCESS error means that you’re not correctly releasing ChangingView everywhere (which, by the way, you should probably call ChangingView***Controller*** so as not to confuse people whether it’s a subclass of UIView or UIViewController).

    Check whether ChangingView’s dealloc method is actually ever called. Ever. There’s not enough information or code to tell you where you’re forgetting to release it, but I’m betting that’s where the problem is at.

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

Sidebar

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.