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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:17:02+00:00 2026-05-25T16:17:02+00:00

In my app im calling presentModelViewController to present a new controller. Everytime this action

  • 0

In my app im calling presentModelViewController to present a new controller. Everytime this action is triggered memory is allocated. But somehow its not releases properly because at some point my app is using too much memory and it craches.

Probably this is because im not releasing the property objects not correctly ( or not at all ) Is the undermentioned the right way? The dealloc is probably, but what about the viewDidUnload?

- (void)viewDidUnload {
    [_sushiTypes release];
    _sushiTypes = nil;
}

- (void)dealloc {
    [_sushiTypes release];
    _sushiTypes = nil;
    [super dealloc];
}
  • 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-25T16:17:02+00:00Added an answer on May 25, 2026 at 4:17 pm

    Don’t forget the call to super in viewDidUnload. You should also access your instance variable through its setter to set it to nil in viewDidUnload. In dealloc, just release the instance variable directly.

    - (void)viewDidUnload {
    [super viewDidUnload];
    NSLog(@"viewDidUnload being called");
    self.sushiTypes = nil;
    }
    
    - (void)dealloc {
    [_sushiTypes release];
    NSLog(@"dealloc being called");
    [super dealloc];
    }
    

    I don’t think this is the source of your memory problems though. Does your modal view controller have any other instance variables or IBOutlets?

    To help debug further, try using Instruments. From Xcode, go Product > Profile, then choose the Allocations template when Instruments opens. Then open and close your modal view controller multiple times, and inspect your leaks and allocations. If Allocations are growing each time you present/dismiss, then try clicking the ‘Mark Heap’ button before and after each present/dismiss. You can then inspect the objects that are being allocated and not deallocated with each cycle.

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

Sidebar

Related Questions

My app is calling the rqst_run method below in didViewLoad method but I've an
I am trying to integrate with a vendors app by calling it with command
I need a console app which will calling webmethod. It must be asynchronous and
here is the problem : there is classic asp app which is calling lame.exe
when calling a SSIS package (C# app) using LoadFromSqlServer, does the user account have
I am calling a web service from a C# forms based app. ServReturnType obj
I'm calling a web service from a console app - all in C# on
i deployed my App to my iPhone and get Unknown error calling sqlite3_step (8:
It seems that calling a P-Invoke while the App is not completed loaded make
I am making an app in which i need to implement calling emergency medical

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.