Re: NSArrayController can't insert object
Re: NSArrayController can't insert object
- Subject: Re: NSArrayController can't insert object
- From: Timothy Larkin <email@hidden>
- Date: Mon, 10 May 2004 17:19:15 -0400
On May 10, 2004, at 4:04 PM, Scott Anguish wrote:
>
Finally, the easiest option might be to disable the filtering
>
automatically when you drag in a new item. It's not likely the best
>
UI experience, but better than dragging it in, and having it disappear
>
immediately because it gets filtered.
The crucial fact, which I didn't realize, is that
insertObject:atArrangedObjectIndex calls arrangeObjects (which does the
filtering) with an array containing a single object, namely the object
to be inserted. This makes some sense. The filter returned an empty
array, which caused the exception. By disabling the filter during the
insert, the entry was added even though it did not pass the filter.
>
>
You could also change the way the insert is done.. how are yo udoign
>
it now?
I call insertObject:atArrangedObjectIndex:, but the same thing happened
if I called addObject instead.
Thanks for the tip.
Tim Larkin
Abstract Tools
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.