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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:23:16+00:00 2026-06-14T14:23:16+00:00

I am quite beginner in development and I’m making an application that have about

  • 0

I am quite beginner in development and I’m making an application that have about 150 ViewControllers ! Each one have a UIImageView.

I’ve been doing a bit of testing, and after a use the app for a while on the iPhone itself, it Crashes when I keep viewing the ViewControllers.

I’ve been analyzing this in instruments, and I have no leaks, however my memory allocation just goes up and up and when I keep viewing the ViewControllers on my iPhone the usage just goes up and up until a crash.

I think it’s clear that it’s crashing because the app is simply taking up too much memory.

So could any one explain how to release viewControllers in order to free up the memory so there will be no crash

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-06-14T14:23:17+00:00Added an answer on June 14, 2026 at 2:23 pm

    The first question you need to ask yourself is why do you need 150 ViewControllers.
    Do you want to present 150 different images?
    If so, then multiple ViewControllers is not the way to go. You probably need to use a UIScrollView that will contain your images (not all of them at once, of course. Use lazy loading).

    What’s probably happening in your case is that you call “pushViewController” each time you need to display a new ViewController, but this doesn’t release the previous ViewController. It simply stacks all of the previous ViewControllers and retains their pointers.

    You see, the way Navigation Controllers work is that they have an array of view controllers. Every time you present a new view controller, it is added at the end of the array. When you click on “Back” or call “popViewController” the last item of the array is removed (and then released automatically from memory).

    See this and this questions to learn how to create a UIScrollView to scroll images.

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

Sidebar

Related Questions

I'm quite a beginner at database design. I have two problems that I'd like
(Disclaimer: I'm a beginner in mobile application development and I'm quite weak with programming
i'm quite a beginner in C# , i tried to write a program that
I'm a beginner at Andengine, but I have read quite a lot of tutorials
I'm quite new to threading in Python and have a couple of beginner questions.
For quite awhile I have been trying to make a simple game in Java
Slap me if I am going about this wrong, I am quite the beginner.
I've read quite a few beginner's books on C++, and a little beyond that,
I am an extreme beginner and have done quite a bit of searching on
I have a problem with MATLAB that i cant quite fix. It is throwing

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.