• 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
Re: Reliable way to find out if CoreData finished loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reliable way to find out if CoreData finished loading


  • Subject: Re: Reliable way to find out if CoreData finished loading
  • From: Mantas Masalskis <email@hidden>
  • Date: Sat, 19 Sep 2009 13:26:59 +0300

Hi,

I have 3 objects in Interface Builder: NSArrayController, NSManagedObjectContext and object that is NSApp's delegate.

NSManagedObjectContext is using XML store as backend

NSArrayController is binded to NSManagedObjectContext

When application starts, on applicationFinishedLauncing NSArrayController is empty. [nsarraycontroller fetch:] didnt help. However, after a while, it has all data just fine....

What is the appropriate way to do smth once Managed Object Context is loaded?

"smth" is to get count of certain objects on applic start

Mantas Masalskis

On Sep 18, 2009, at 7:08 PM, I. Savant wrote:

On Sep 17, 2009, at 6:46 PM, Mantas Masalskis wrote:

I'm loading Core Data object via Managed Object Context in IB. It looks like it hasn't finished loading when applicationDidFinishLoading is fired.


Perhaps thinking about this a different way would clarify things. You don't "load a context". You create a context and use it to fetch objects from the store (or merely to create objects if you're using an in-memory store).

So, if you have some controllers that aren't ready yet, you can simply instruct them to -fetch: ... this will force them to fetch immediately, rather than waiting for a future cycle of the run loop.

What is the appropriate way to do smth once Managed Object Context is loaded?

What's a "smth"?

--
I.S.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >Reliable way to find out if CoreData finished loading (From: Mantas Masalskis <email@hidden>)
 >Re: Reliable way to find out if CoreData finished loading (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Reliable way to find out if CoreData finished loading
  • Next by Date: Re: NSNotificationQueue : NSPostingStyle : Definitions for Dummies
  • Previous by thread: Re: Reliable way to find out if CoreData finished loading
  • Next by thread: 2 simple questions
  • Index(es):
    • Date
    • Thread