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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:26:16+00:00 2026-06-09T15:26:16+00:00

Part of the app I’m working on involves a UIPageViewController, where each page displays

  • 0

Part of the app I’m working on involves a UIPageViewController, where each page displays an ‘entry’ that is stored in Core Data. An entry includes, among other things, some images that are being compressed and stored as NSData. Thus, to load these images and display them on a page, I’m using imageWithData, i.e.

photo.image = [UIImage imageWithData:entry.photo];

The problem is that imageWithData is not particularly quick, and so flipping through pages is not as responsive as I would like. My best attempt at remedying this situation has been to preload a number of the view controllers that are displayed by my UIPageViewController into an array. (Not sure if that’s the best thing to do, but there you have it)

So, to clarify, I have a navigation controller, which contains viewControllerA, which then links to viewControllerB – which displays the UIPageView and the entryControllers (one entryController on each page). The problem is that when I use the navigation bar to go back from viewControllerB to viewControllerA, I want viewControllerB’s array of entryControllers to be released from memory. But, ARC doesn’t seem to be doing so. Therefore, after going back and forth between viewControllerA and viewControllerB a few times, turning a few pages each time, I start to get memory warnings – which ends up clearing the current array of entryControllers, and defeats the purpose of having that array, since the entries then have to be reloaded every time I get a memory warning.

In short, ARC isn’t clearing any of the memory I’ve allocated for viewControllerB when I go back to viewControllerA via my navigation controller. I don’t like that. If anyone could suggest a reason that this is happening, or let me know if I’m going about this whole thing the wrong way, it would be hugely appreciated. I’m just trying to speed up the transition from one page to the next!

Thanks a bunch.

  • 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-09T15:26:17+00:00Added an answer on June 9, 2026 at 3:26 pm

    The only reason for ARC to not release your memory is that you still are retaining it somewhere. Only you know where that is.

    Usually, this is caused by a retain cycle, which can happen easily with blocks.

    However, it is just as likely that you are keeping a pointer to the object someplace, in a controller, an iVar, or some collection.

    Have you run the static analyzer on your code? It’s pretty good at finding some of those things.

    What does instruments tell you? It’s got some neat tools for finding leaks and retain cycles.

    EDIT

    You can have as many references to any object that you want. Once the count goes to zero, it will be released.

    The problem is that you are holding an array of strong pointers to view controllers as a cache. If you want them released, you have to manually nil those pointers. You are somehow pre-loading controllers into an array. They will stay alive until you unload them.

    So, as long as you have a strong pointer to something, it will stay around.

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

Sidebar

Related Questions

Part of an app I am working on includes a log file viewer, with
This part of an app that I am working on, I have the following
Part of an app I'm working on involves a messaging interface which I'm trying
Part of my app caches web pages for offline viewing. To do that, I
I have a part of my app that takes a screenshot of a certain
Part of this app is a Scream button that plays random screams from cast
I have an app with a manifest that requires running as administrator, but part
Part of my app includes volume automation for songs. The volume automation is described
I am building a django app as part of it I have a page
As part of our app, user can save some data as XML on server

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.