• 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: refreshing core data controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: refreshing core data controller


  • Subject: Re: refreshing core data controller
  • From: Pavel Hlavnicka <email@hidden>
  • Date: Thu, 31 May 2007 10:50:03 +0200

Thanks,

using fetch methods is what I usually do. In this case I want to use the controller because I want to set the UI as it was before managed context reset.

It means: I have a table with a couple of items and selection index is say 2. After reset selection index is always 0. I need to find the relevant item (by walking trough array controller) and set selection index to index of the item selected recently.

Perhaps I need just to postpone this action using -[NSRunLoop performSelector:] or similar...

Any other tips for some solution workaround?

Thanks

Pavel

Chris Hanson wrote:
On May 30, 2007, at 7:43 AM, Pavel Hlavnicka wrote:

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.

It sounds like you're trying to treat your NSArrayController as part of your model. You should use Core Data directly -- execute fetch requests against your managed object context and so on -- from within model code. NSObjectController and its subclasses are intended to mediate between your model and your view layers, not to provide a way to manipulate your model directly.


-- Chris
_______________________________________________

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


References: 
 >refreshing core data controller (From: Pavel Hlavnicka <email@hidden>)
 >Re: refreshing core data controller (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Creating TIFF image with one strip only in Cocoa
  • Next by Date: RE: Qt embedded in Cocoa
  • Previous by thread: Re: refreshing core data controller
  • Next by thread: NSArray or MutableArray Null/NIL placeholder
  • Index(es):
    • Date
    • Thread