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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:29:25+00:00 2026-05-20T00:29:25+00:00

I’m working on my first iPhone app. My UI is composed of 4 tabs.

  • 0

I’m working on my first iPhone app. My UI is composed of 4 tabs. The first tab shows active projects. The last tab is a “settings” tab where user can toggle projects on/off. The settings tab has a NSMutableArray of projects (retrieved from a webservices call) and I write them out to a file in the Documents folder for the app. The first tab reads the projects from the file by reinstating the file into a NSMutableArray and only showing the projects with an IsActive bit set to true. Everything is working, except when I trip a project’s status in the settings tab then immediately click on the first tab. The first tab is not reflecting the changes made in the settings tab. However, if I click on one of the other tabs before going to the first tab, then the first tab reflects the changes made in the settings tab appropriately. The only thing I can think of is the file is not finished writing to the Documents folder when going directly from settings tab to the first tab. I’m writing the NSMutableArray in the ViewDidDisapper event for the Settings tab. What am I missing? Thanks for your help.

  • 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-20T00:29:25+00:00Added an answer on May 20, 2026 at 12:29 am

    Unless your data sets are large, I find it’s much better to hold all data in memory, and only write to disk on app terminate/to-background and read from disk on app launch. Create a singleton “FooManager” class to hold data required in different parts of your app, and access the data through the API of the singleton class. I think this is much cleaner than hanging everything off of ProjectAppDelegate. This should also solve your write/read race condition.

    EDIT: here’s a tiny little singleton network image cache manager class I’m using in a current project. Sometimes an example’s worth a thousand words of tutorials :). In order to use this class, in any code, just #import the header, and do:

    NetworkImageCacheManager *nicm = [NetworkImageCacheManager sharedInstance];
    UIImage *img = [nicm imageWithURL:imageURL];
    

    Here’s the code for this class:

    #import <Foundation/Foundation.h>
    
    
    @interface NetworkImageCacheManager : NSObject 
    {
        NSMutableDictionary *imgCache;
    }
    
    @property (nonatomic, retain) NSMutableDictionary *imgCache;
    
    + (NetworkImageCacheManager *) sharedInstance;
    - (UIImage *) imageWithURLString:(NSString *)imgURLString;
    - (void) setImage:(UIImage *)theImage forURLString:(NSString *)imgURLString;
    
    @end
    
    
    @implementation NetworkImageCacheManager
    @synthesize imgCache;
    
    - (id) init
    {
        self = [super init];
        if ( self ) 
        {
            self.imgCache = [NSMutableDictionary dictionary];
        }
    
        return self;
    }
    
    
    + (NetworkImageCacheManager *) sharedInstance
    {
        static NetworkImageCacheManager *g_instance = nil;
    
        if ( g_instance == nil )
        {
            g_instance = [[self alloc] init];
        }
    
        return g_instance;
    }
    
    
    - (UIImage *) imageWithURLString:(NSString *)imgURLString
    {
        UIImage *rv = [self.imgCache objectForKey:imgURLString];
        return rv;
    }
    
    - (void) setImage:(UIImage *)theImage forURLString:(NSString *)imgURLString
    {
        [self.imgCache setObject:theImage forKey:imgURLString];
    }
    
    - (void) dealloc
    {
        [imgCache release];
        [super dealloc];
    }
    
    
    
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I need to clean up various Word 'smart' characters in user input, including but

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.