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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:26:16+00:00 2026-05-26T07:26:16+00:00

Hi I using blocks to implement the pushing of viewcontrollers onto a stack. My

  • 0

Hi I using blocks to implement the pushing of viewcontrollers onto a stack. My code is as follows:

My Question is, for memory management, where can I release the firstView instance? I tried to release it in the completion block itself but I will get a “memory issue” if I press the back button from splashView to the firstView

FirstViewController *firstView = [[FirstViewController alloc]init];

[firstView setCompletionHandler:^(BOOL isRequestInvite){

    splashView=[[AuthSplashController alloc] init];
    [splashView setCompletionHandler:onceCompleted];

    [navCon pushViewController:splashView animated:YES];
    //[firstView release];

}];

[navCon pushViewController:firstView animated:NO];

So in this case, where would be the best place to release firstView?

  • 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-26T07:26:16+00:00Added an answer on May 26, 2026 at 7:26 am

    I think you can release firstView after pushing it on navigation stack, because retain count will be increased:

     [navCon pushViewController:firstView animated:NO];
     [firstView release];
    

    Or you can mark that object as autoreleased:

     FirstViewController *firstView = [[[FirstViewController alloc]init] autorelease];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Code::Blocks to compile a shared library on Ubuntu. When I make a
Out of habit I've been using try/catch blocks in my application code for all
We're developing a Qt project using the Code::Blocks IDE with the QtWorkbench plugin. We'd
I am trying to implement a type of slider using jquery. However this question
I'm trying to implement iPhone like PIN-code authorization with 4 EditText blocks like this:
Implement using existing Synchronized Java classes (Hashtable, StringBuffer, Vector) or synchronize the blocks when
I'm looking for a way to implement consecutive animations using nested animation blocks. Somewhat
How can I filter (replace empty() function) in my div container using mootools? Question
I am currently using two catch blocks after a try block. The first catches
I am using statfs() which gives me the free blocks available to a non-superuser.

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.