NSMatrix and Predicate Searching
NSMatrix and Predicate Searching
- Subject: NSMatrix and Predicate Searching
- From: "Josh Ferguson" <email@hidden>
- Date: Thu, 28 Dec 2006 09:53:07 -0600
- Thread-topic: NSMatrix and Predicate Searching
I've currently got an NSMatrix of images bound to an NSArray controller.
I recently implemented the predicate bindings so that I could have live
search capabilities. Everything works great - except that when the
search criteria preclude all except for one item (not the selected one),
the non-selected items gets selected. The drawRect method, for some
reason, calls -selectCellAtRow:column: passing it the 0,0 coordinates
even though that cell shouldn't be selected at all. This seems to be
called some time during the _selectFirstEnabledCell private method. The
really strange part is, if I override _selectFirstEnabledCell as an
empty function, it stops the behavior (but also breaks the
re-highlighting of the selected cell when it comes back into the
view)...if I try to selective re-highlight cells based on the content,
it starts re-highlighting the first cell when it's reduced to one
(non-selected) cell. I only need to check the NSArrayController for its
selection indexes to change this behavior - in other words, I don't
actually perform any operations on selecting or deselecting cells, if I
simply send a message to the NSMatrix's controller object, it changes
the behavior of the selection. Strange stuff...does anyone have any
insight into this? Or any recommendations on where to look?
_______________________________________________
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