• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
refreshing core data controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

refreshing core data controller


  • Subject: refreshing core data controller
  • From: Pavel Hlavnicka <email@hidden>
  • Date: Wed, 30 May 2007 16:43:42 +0200

Dear all,

I have an application using Core Data. In my nib file I have a couple of NSArrayControllers bound to NSManagedObject context and core data entities with no predicates.

In a separate thread I'm changing the data (shared instance of coordinator, separate instance of managed context). Then I need to refresh data in the main thread (UI).

I use -[NSManagedObjectContext reset] and various combinations of -[NSArrayController repareContent] and -[NSArrayController fetch:]

My UI is refreshed fine but I'm having problems to access values via -[NSArrayController arrangedObject] right after I call reset on the managed context - arrangedObjects returns just an empty array.

Is there something I'm missing? Is there some better way how to do it?

Sample code follows:

[myManagedContext reset];
[myController prepareData];
[myController fetch:self];

NSArray * arr = [myController arrangedObjects]; //ALWAYS EMPTY


.... but UI a bit later is refreshed correctly.

Thank you

Pavel
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: refreshing core data controller
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: how to access a c++ vector member of an objc class?
  • Next by Date: Re: Window freezes app
  • Previous by thread: Re: how to access a c++ vector member of an objc class?
  • Next by thread: Re: refreshing core data controller
  • Index(es):
    • Date
    • Thread