• 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: NSArrayController: add an object without selecting?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController: add an object without selecting?


  • Subject: Re: NSArrayController: add an object without selecting?
  • From: Miguel Sanchez <email@hidden>
  • Date: Tue, 15 Nov 2005 17:47:31 -0800

have you tried unchecking "Selects Inserted Objects" in the array controller attributes inspector?

- Miguel

On Nov 15, 2005, at 3:33 PM, Josh Burnett wrote:

I've got myself a bit of a sticky situation. I have what amounts to an array of arrays, so I'm using the standard set of two cascading NSArrayControllers, with the first being bound to my top- level array of objects, and the second being bound to the selection of the first. So far, so good.

The problem comes in when I try to add an object to the first array. If I use the handy addObject: method, the controller tries to be even more helpful by going ahead and selecting the new object, too. The thing is, I don't want it to, as that makes my second controller change to the newly added object. So, for now, I'm trying to make an end run around it by manually adding the object to the array, and bracketing this in (will/did) ChangeValueForKey: calls. I have the NSTableView associated with the first controller set to preserve the selection, which it does just fine.

Here's the rub: even though the selection isn't changing, the downstream array controller is re-loading its data, which has some side effects that I don't want. How can I avoid this re-selection?

On a side note, is there a way to make the default selection of an NSArrayController be empty?

Thanks,

Josh

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSArrayController: add an object without selecting? (From: Josh Burnett <email@hidden>)

  • Prev by Date: Re: Reference to entity name in NSPredicate?
  • Next by Date: Re: Need suggestion for data storage solution for AB-like app
  • Previous by thread: NSArrayController: add an object without selecting?
  • Next by thread: Distributed Objects and KVO/KVC
  • Index(es):
    • Date
    • Thread