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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:09:31+00:00 2026-05-14T05:09:31+00:00

I got this error from XCode: objc[8422]: FREED(id): message release sent to freed object=0x3b120c0

  • 0

I got this error from XCode:

objc[8422]: FREED(id): message release sent to freed object=0x3b120c0

I googled and find that is related to the memory. But I don’t know which line of code I go wrong, any ideas? After I launch my app in simulator, it prompts a second, than, no other error except the error above.

@implementation MyAppDelegate

@synthesize window;
@synthesize viewController;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after app launch    
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];

    [self changeScene:[MainGameMenuScene class]];
}


- (void)dealloc {
    [viewController release];
    [window release];
    [super dealloc];
}

- (void) changeScene: (Class) scene
{
    BOOL animateTransition = true;

    if(animateTransition){
        [UIView beginAnimations:nil context:NULL];
        [UIView setAnimationDuration:0.5];
        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES]; //does nothing without this line.
    }

    if( viewController.view != nil ) {
        [viewController.view removeFromSuperview]; //remove view from window's subviews.
        [viewController.view release]; //release gamestate 
    }

    viewController.view = [[scene alloc] initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT) andManager:self];

        //now set our view as visible
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];

    if(animateTransition){
        [UIView commitAnimations];  
    }   
}
  • 1 1 Answer
  • 1 View
  • 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-14T05:09:32+00:00Added an answer on May 14, 2026 at 5:09 am
    [viewController.view release]; //release gamestate
    

    That’s an extra release (if you didn’t alloc it, don’t release it). A couple lines down:

    viewController.view = [[scene alloc] initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT) andManager:self]; 
    

    will release viewController.view again before retaining the new value, that will over-release the view and cause a crash (it sends the release message to an object that has already been dealloc’d / memory that has already been freed). Instead, try:

    scene *view = [[scene alloc] initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT) andManager:self];
    viewController.view = view; // setView will release the old/retain the new
    [view release];             // so you don't need to worry about releasing it later
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got this error message while trying to load view: The model item passed into
Got this error message while trying to configure an entitydatasource in the designer: My
I am compiling my first Linux Kernel Module, when i got this error: from
Im new to xCode programming, ive got this code from an ebook tutorial playing
Got this error for the first time, I have looked around and cannot find
While running my project, I've got this error message. Could not load the bs_back_light.png
I got this error when I upgraded from primefaces 3.0.M3 to 3.0.M4-SNAPSHOT @60,114 Parent
Got this error on a big $_GET query in size ~9 000 symbols (they
I got this error when I was installing the SugarCRM on the server: Fatal
i got this error in the logcat 06-21 11:58:27.275: E/AndroidRuntime(404): java.lang.RuntimeException: Unable to start

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.