Re: NSArrayController not rearranging correctly

2012-07-19 Thread Markus Spoettl
On 7/19/12 8:40 AM, Quincey Morris wrote: 2. Use a brute force flag when setting the predicate, something like this: dontStartExpensiveUpdate = YES; [_arrayController setPredicate: …]; [_arrayController rearrangeObjects]; // at this point, the KVO notification has been sent up to twice, but igno

Re: NSArrayController not rearranging correctly

2012-07-19 Thread Quincey Morris
On Jul 18, 2012, at 23:22 , Markus Spoettl wrote: > The array controller is used by views directly, they bind to arrangedObjects > (like in the example). Since when is it recommended to insert an intermediate > object between table view and NSArrayController? Ugh, I didn't pay enough attention

Re: NSArrayController not rearranging correctly

2012-07-18 Thread Quincey Morris
On Jul 18, 2012, at 23:22 , Markus Spoettl wrote: > That doesn't sound right. The array controller is used by views directly, > they bind to arrangedObjects (like in the example). Since when is it > recommended to insert an intermediate object between table view and > NSArrayController? Makes t

Re: NSArrayController not rearranging correctly

2012-07-18 Thread Markus Spoettl
On 7/19/12 2:15 AM, Quincey Morris wrote: Oddly, the other operators (e.g. NSGreaterThanOrEqualToPredicateOperatorType) work fine. You might find a workaround using a combination of predicates using different operators. I'd be delighted if someone told me it's all my fault. Can anyone point out

Re: NSArrayController not rearranging correctly

2012-07-18 Thread Quincey Morris
On Jul 18, 2012, at 08:52 , Markus Spoettl wrote: > I also looked at the predicate operator type as a potential source of the > issue but I can't see a problem there. I'm using > NSEqualToPredicateOperatorType is fine, as I do want a comparison using > -equalTo: . NSMatchesPredicateOperatorType

Re: NSArrayController not rearranging correctly

2012-07-18 Thread Markus Spoettl
On 7/17/12 11:41 PM, Markus Spoettl wrote: 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

Re: NSArrayController not rearranging correctly

2012-07-18 Thread Markus Spoettl
On 7/18/12 2:14 AM, Ken Thomases wrote: I would check if an exception has been thrown during the setting of the filter, thus interrupting it from rearranging the objects. My suspicion is that you have a KVO-compliance bug that means that it can't unregister an observation. That would log into

Re: NSArrayController not rearranging correctly

2012-07-18 Thread Markus Spoettl
On 7/18/12 1:15 AM, Mike Abdullah wrote: 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 chan

Re: NSArrayController not rearranging correctly

2012-07-17 Thread Mike Abdullah
On 17 Jul 2012, at 22:41, Markus Spoettl wrote: > 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

Re: NSArrayController not rearranging correctly

2012-07-17 Thread Ken Thomases
On Jul 17, 2012, at 4:41 PM, Markus Spoettl wrote: > 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