NSArrayController not rearranging correctly
NSArrayController not rearranging correctly
- Subject: NSArrayController not rearranging correctly
- From: Markus Spoettl <email@hidden>
- Date: Tue, 17 Jul 2012 23:41:56 +0200
Hello,
I have an NSArrayController (automaticallyRearrangesObjects = YES) on which I
set a filterPredicate in code (not through bindings). Most of the time,
rearranging works but in one 100% reproducible case, the controller produces an
empty arrangedObjects array when it should produce a non-empty one.
It always happens if a certain predicate (A) was set before the predicate that
produces the wrong result (B) is set. If any another predicate (or none) is set
when setting (B), arrangedObjects is correctly populated. This is completely
reproducible.
When I call rearrangeObjects on the array controller, the result gets rectified.
However, even with automaticallyRearrangesObjects = NO, the array controller
rearranges automatically so when I rearrange manually after setting the filter,
I get two KVO change notifications for arrangedObjects which can be very costly
and I'd really like to avoid that.
Any ideas on how to force NSArrayController to (1) either produce a correct
result automatically or (2) prevent to do any rearranging by itself when a
filterPredicate is set?
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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