• 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
NSArrayController loses selection upon CoreData refreshObject.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController loses selection upon CoreData refreshObject.


  • Subject: NSArrayController loses selection upon CoreData refreshObject.
  • From: Motti Shneor <email@hidden>
  • Date: Mon, 20 Jun 2011 09:47:23 +0300

Hello everyone.

I'm experiencing rather weird behavior of NSArrayController, and I wonder if any of you have a clue.

Background: I use an NSTableView with an NSArrayController to display a list of CoreData entity instances (say instances of  "Note" entity).  I DO NOT configure the array controller for "Entity" mode, because this is a "read only" view. All model changes originate in remote server commands. My client  application merely sends requests to the server, and server decides upon model changes.

NSArrayController is configured for "Class" (NSManagedObject), and its ContentSet is bound to some relation property that leads to all the Notes.

The symptom is:  When user clicks on a table line --- it gets selected. If, however, a server message arrives that causes the client to call

[context refreshObject:obj] mergeChanges:YES];

Selection disappears immediately. I double checked that NONE of the NSManagedObjects  (Note instances) has changed, and no new Note was added, and no Note was removed. The refresh is used to update some Fetched properties (queries).

I played with the NSArrayController configuration, to no avail. Nothing in the docs explains this behavior. However, the UI behavior is unbearable.

Ideas anyone?


Thanks ---


Motti Shneor,
Senior Software Engineer and Team Leader,  Spectrum Reflections LTD.
---
ceterum censeo microsoftiem delendam esse
---










_______________________________________________

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

  • Follow-Ups:
    • Re: NSArrayController loses selection upon CoreData refreshObject.
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Loop between observers with KVO from UIScrollView
  • Next by Date: Re: How to redraw a view in slow-motion
  • Previous by thread: Re: Weird behavior of -URLByAppendingPathComponent:
  • Next by thread: Re: NSArrayController loses selection upon CoreData refreshObject.
  • Index(es):
    • Date
    • Thread