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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:49:21+00:00 2026-06-07T05:49:21+00:00

this is probably a newbie question… I’m trying to reduce the amount of memory

  • 0

this is probably a newbie question…

I’m trying to reduce the amount of memory usage in my iPhone app.

I have an UIViewController with a set of buttons. When the user taps any of them, the app takes him to a new screen (new UIViewController).

Should I create them on demand ([[MyUIViewController alloc] initWithNibName:@”MyUIViewController” bundle:nil];), or should I have all these UIViewControllers as @propertys in the “main” controller, and create them only the first time? (check if they are nil).

I noticed (with Instruments) that, following the first approach, the used memory (Live bytes) increases on push but does not decrease when pulling the controller, and so on every time I press a button.

Furthermore, does that also applies to UITableViews, where I push another UIViewController in tableView:didSelectRowAtIndexPath: method?

Thank you in advance.

EDIT: I’m using ARC

  • 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-07T05:49:23+00:00Added an answer on June 7, 2026 at 5:49 am

    Keeping them around and reusing them will keep your apps base memory at a higher level, but will probably increase the performance as these will not need to be recreated on demand.

    That being said, the performance of pushing a new view controller is not very bad to begin with (unless you are doing something wrong) so just create them on demand.

    If the old VC memory is not being released when popped, you might have a retain cycle somewhere. Look for any delegate code you may have written that is not getting cleared on the dismissal of the view.

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

Sidebar

Related Questions

This is probably a very newbie question but what I'm trying to do is
this is probably a newbie question regarding memory manegment. How can i release an
Probably this is a newbie question :) But I have some Flash games built
This is probably a newbie question. I have a table USER which contains info
While trying out jQuery, I have a question that is probably a newbie mistake,
I'm a bit new to Rails/RSpec/Capybara, so this is probably a newbie question, but
This is probably a really newbie question (well, I'm pretty sure it is), but
I realize this is probably a hopelessly newbie question, but what is the difference
This is a very newbie question and i will probably get downvoted for it,
this must be a newbie question. I have this method in a controller: public

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.