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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:09:24+00:00 2026-05-30T11:09:24+00:00

I am currently building an application that generates images and stores them in an

  • 0

I am currently building an application that generates images and stores them in an NSMutableArray, which then used in a UINavigation (Cell.imageView.image). I need to be able to handle up to 2000 images without causing lag in my application.

Currently how I set this generating is by calling the generating method when cellForRowAtIndexPath is accessed. Which seems to cause a 4-5 second lag before the next navigation is called.

fortunately after those 4-5 seconds the generating is done and there is no issues.

In the world of iProducts waiting 4-5 seconds isn’t really an option. I am wondering what my options are for generating these images in the background. I tried using threads [self performSelectorInBackground:@selector(presetSnapshots) withObject:nil];
but that only gave me issues about vectors for some reason.

Heres the generating code:

-(void)presetSnapshots{
    //NSAutoreleasePool* autoReleasePool = [[NSAutoreleasePool alloc] init];
    for (int i = 0; i < [selectedPresets count]; ++i){
        GraphInfo* graphInfo = [selectedPresets objectAtIndex:i];
        graphInfo.snapshot = [avc takePictureOfGraphInfo:graphInfo PreserveCurrentGraph:false];
        [graphInfo.snapshot retain];
    }
    //[autoReleasePool drain];
    presetSnapshotFinished = YES;

}

inside - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { is

   if (presetSnapshotFinished == NO){
        [self presetSnapshots];
        //[self performSelectorInBackground:@selector(presetSnapshots) withObject:nil];

    }

    cell.imageView.image = [[selectedPresets objectAtIndex:indexPath.row] snapshot];

Edit:

I also rather not use coreData for this. The images are 23×23 and coming out to about 7kb. So its about 6MB being use at any giving time in memory.

  • 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-30T11:09:26+00:00Added an answer on May 30, 2026 at 11:09 am

    You can use Grand Central Dispatch (GCD) to fire up [self presetSnapshots]

    dispatch_queue_t working_queue = dispatch_queue_create("com.yourcompany.image_processing", NULL);
    dispatch_queue_t high = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,NULL);
    dispatch_set_target_queue(working_queue,high);
    dispatch_queue_t main_queue = dispatch_get_main_queue();
    
    dispatch_async(working_queue,^{
        if (presetSnapshotFinished == NO){
           [self presetSnapshots];
        }
        dispatch_async(main_queue,^{
            cell.imageView.image = [[selectedPresets objectAtIndex:indexPath.row] snapshot];
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently building an application that is about VOIP / random chatting, which is
I am building a web application that is currently PHP with MySQL. There is
I'm currently working on a project that is building a java-based desktop application to
I'm currently building a simple application on Gjs , which should change the background-image
I am currently building a Rails 3.2 application that uses the gem sunspot to
I am currently building an application that requires the identification of an element by
I'm currently building an application that shows a line-graph and uses MSChartControl. Here is
We're currently building an application that executes a number of external tools. We often
I'm currently building an application that is intended to run on an embedded system
I have an application that I'm currently building that requires me to display a

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.