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

  • Home
  • SEARCH
  • 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 4085764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:37:35+00:00 2026-05-20T18:37:35+00:00

I have made a question which is a bit similar to this, though the

  • 0

I have made a question which is a bit similar to this, though the old one actually got solved but I found a new issue which relates a bit. Anyways, I chose to make seperate topics.

I have an application which reads data from a property list on my webserver. I want the application to be usable when offline therefore I copy the property list onto the iPhone as Bands.plist and I read the data from the local plist.

My problem is, that if the data has been updated and an old version of Bands.plist is stored on the device, then my application starts reading from Bands.plist while updating and the data becomes a mix of old and new data which causes the application to crash. I can’t figure out how to fix this issue and hope that someone has an idea.

I have an image which illustrates my issue:

On the left is the old data and on the right is the new data

What happens is, that my view has a subview which has a page controller. Each page contains a table view where the data is loaded into.

Here you see that I am sliding from one view to another. In the first view (the left) is the old data and in the second view (the right) is the new data. In this transition of views, the application crashes.

Can anyone help me figure this out? It seems that the application starts loading the data before it is saved.

Here is some code. Please say, if more code will help. I can’t figure out how to fix this issue.

This is from the App Delegate. Here the data is retrieved from the webserver and is saved to Bands.plist.

NSLog(@"[AppDelegate] Data has been downloaded.");

    // throw data into a property list (plist)
    NSMutableArray *tmpArray = [NSPropertyListSerialization propertyListFromData:receivedData mutabilityOption:NSPropertyListMutableContainers format:nil errorDescription:nil];

    NSMutableArray *plistArray = [[NSMutableArray alloc] initWithArray:tmpArray];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Bands.plist"];

    NSLog(@"[AppDelegate] Bands.plist has been populated.");

This is from the table view. Here the data is loaded from Bands.plist.

    pageNumber = page;

            NSLog(@"[TableView] Loading view.");

            NSArray *whatDays = [[NSArray alloc] initWithObjects:@"Onsdag", @"Torsdag", @"Fredag", @"Lørdag", @"Ikke programsat", nil];

            sections = [[NSMutableDictionary alloc] init];

            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
            NSString *documentsDirectory = [paths objectAtIndex:0];
            NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Bands.plist"];
            tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path];

            // scan through data and sort
            for(int i = 0; i < [whatDays count]; i++) {
                NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.weekDay == %@", [whatDays objectAtIndex:i]];
                NSArray *bandsThisDay = [tmpArray filteredArrayUsingPredicate:predicate];
                [sections setObject:bandsThisDay forKey:[whatDays objectAtIndex:i]];
            }

            [whatDays release];

Would it be possible to call a method in tableview implementation from the app delegate and tell it to populate the table? So it’s waiting for the download to be done?

  • 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-20T18:37:36+00:00Added an answer on May 20, 2026 at 6:37 pm

    I solved this by sending a notification to NSNotificationCenter and add an observer to the table view which will wait for the notification and then call reloadData on the table.

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

Sidebar

Related Questions

Coming from this question , I have a wxComboCtrl with a custom popup made
I know many have asked this question, but I think my situation is a
Question for YUI experts... I have a table and I've made each cell of
I have made some code which exports some details of a journal article to
I have made a new windows service which works fine using barebone code (just
This question has been answered. I've improved the code a bit (at least I
I'm sorry this question is going to be a bit vague because I'm not
I have made a SVG image, or more like mini application, for viewing graphs
I have made a custom UserControl i Vb.net (windows application). How can I add
I have made a little app for signing up for an event. User input

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.