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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:49:15+00:00 2026-06-03T09:49:15+00:00

Struggling a bit here… My view controller adheres to following protocols In my init

  • 0

Struggling a bit here…

My view controller adheres to following protocols

In my init method I will check a remote server to get an updated XML file… parse the XML file, and write the contents to Core Data.

My tableview’s content is managed with NSFetchedResultsController that displays this Core Data.

My Problem:

NSFetchedResultsController seems to be getting the data before the Core Data update from the remote file takes place. I’ve verified the database is being updated properly and if I run a second time the TableView will show the correct data.

Maybe I’m just not doing the reloadData in the proper place? I have implemented

-(void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
    [myTableView reloadData];
}

Also, after the parser completes and the new data has been written to core data I’m trying this:

-(void)parserDidEndDocument:(NSXMLParser *)parser {
     [myTableView reloadData];  
}

Anyone have any ideas? Let me know what extra code might be useful to post. Thanks!

  • 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-03T09:49:17+00:00Added an answer on June 3, 2026 at 9:49 am

    you may want to check the following (from Apple’s docs)

    A controller thus effectively has three modes of operation, determined by whether it has a delegate and whether the cache file name is set.

    1. No tracking: the delegate is set to nil.
      The controller simply provides access to the data as it was when the fetch was executed.

    2. Memory-only tracking: the delegate is non-nil and the file cache name is set to nil.
      The controller monitors objects in its result set and updates section and ordering information in response to relevant changes.

    3. Full persistent tracking: the delegate and the file cache name are non-nil.
      The controller monitors objects in its result set and updates section and ordering information in response to relevant changes. The controller maintains a persistent cache of the results of its computation.

    it sounds like you want full persistent tracking. So you probably want to make sure you have the delegate set (which you probably already have done) and set the cache to non nil

    You may also want to make sure you are saving your managedObjectContext after you are done parsing. After saving, make sure to perform the fetch again.

    NSError *error;
    BOOL success = [controller performFetch:&error];
    if (!success)
      NSLog(@"Core Data Fetch Error:  %@"error);
    

    It could be that the app is saving the context when it is exiting and that is why you are seeing the data when you relaunch.

    Good luck

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

Sidebar

Related Questions

at work I am struggling a bit with the following situation: We have a
I am struggling a bit with a compiler warning. Here the code: const char
I'm struggling a bit with figuring out how to properly set up my view
I've been struggling with a SQL Azure cross-server copy for a bit now -
I am struggling with the post() method. I've been reading several posts on here
I'm struggling a bit with traversing in jQuery. Here's the relevant markup: <ul id=sortable
I'm struggling with NLTK stopword. Here's my bit of code.. Could someone tell me
I'm struggling a bit with the play 2.0 templating system; I have a method
I've been struggling a bit with this tiny problem - and I'm quite sure
I'm a bit struggling with the associative arrays in associative arrays. Point is that

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.