Fwd: NSArrayController can't insert object
Fwd: NSArrayController can't insert object
- Subject: Fwd: NSArrayController can't insert object
- From: Chris Giordano <email@hidden>
- Date: Thu, 13 May 2004 14:05:14 -0400
(Originally sent from wrong account -- sorry for any duplicates.)
Scott,
On May 11, 2004, at 1:17 AM, Scott Anguish wrote:
On May 10, 2004, at 5:05 PM, mmalcolm crawford wrote:
On May 10, 2004, at 7:56 AM, Timothy Larkin wrote:
Any way around this problem?
The "Filtering Array Controller" example at
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html> keeps
a track of added items, and automatically adds them to
arrangedObjects even if they don't meet the current criteria. In
some respects this might better match user expectations anyway...
mmalc and I disagree on this I think. I'm sure it's come up before
between us. :-)
My concern with this UI approach is that at what point do you update
the filter to correctly display only the items that would correspond
to the filter?
I've tried to find an iApp or Apple application that provides for
this situation, but haven't had any luck. If someone can provide any
examples of existing applications and how they handle it, it'd be much
appreciated.
Address Book seems to have relevant behavior:
When one filters the displayed cards by entering a search term and one
then adds a new record, all records are first displayed (i.e., the
filter is removed) before the new record is added:
1. Open Address Book, (optionally) select a group, and search for
something.
2. Create a new card.
a. The filter is removed and the new card is displayed in the
current group.
However, undo and redo do not change the filter. (E.g., remove a card,
search, undo the remove: card is re-inserted but filter remains in
place.) This mention is related to the recent discussion in the thread
"Inserting objects in content array".
A similar but not entirely related behavior is that adding a new card
when a group is selected adds the card to the group. This probably
doesn't match the implementation in Address Book, but if the group were
an attribute of the card, itself, (e.g., a to-one relationship that one
could filter the displayed cards on), this could be seen as specifying
of a default value for this field based on the filter currently in
place. Clearly, this can't be done in all cases -- anything other than
filtering on a relationship would have to make many assumptions or have
lots of restrictions on how the filtering took place in order to fill
in an appropriate default value. However, for a to-one relationship,
this would probably work adequately. Whether it is advisable or
expected behavior is another question. (Not that I'm questioning it.
I would probably expect it. It's mostly that I'm not sure whether
others would or not.)
chris
_______________________________________________
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.