Re: NSArrayController - error inserting object at arranged object index N

2016-06-24 Thread Quincey Morris
On Jun 24, 2016, at 03:12 , Jonathan Mitchell wrote: > > The downside would be having to implement the compliant accessor methods in > the real model object (in my case the array is a constructed property of an > NSViewController subclass which obtains its array data from a non native > Obj-C

Re: NSArrayController - error inserting object at arranged object index N

2016-06-24 Thread Jonathan Mitchell
> On 23 Jun 2016, at 23:03, Quincey Morris > wrote: > > On Jun 23, 2016, at 13:39 , Jonathan Mitchell > wrote: >> >> Do you mean something like this? >> NSMutableArray *proxy = [NSArrayController >> mutableArrayValueForKey:@"content"]; > > That wasn’t what I had

Re: NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Quincey Morris
On Jun 23, 2016, at 13:39 , Jonathan Mitchell wrote: > > Do you mean something like this? > > NSMutableArray *proxy = [NSArrayController > mutableArrayValueForKey:@"content"]; That wasn’t what I had in mind. I meant that you would make the array a property of a real model object, and update *

Re: NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Jonathan Mitchell
> On 23 Jun 2016, at 17:51, Quincey Morris > wrote: > > >> My workaround was to set controller.clearsFilterPredicateOnInsertion == YES >> and reset the filterPredicate following -addObject: >> >> It might be possible to subclass NSArrayController … > > There’s no need to work around at all.

Re: NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Quincey Morris
On Jun 23, 2016, at 08:32 , Jonathan Mitchell wrote: > > It would seem there is some intention here according to the header: > > - (void)insertObject:(id)object atArrangedObjectIndex:(NSUInteger)index; > // inserts into the content objects and the arranged objects (as specified by > index i

Re: NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Jonathan Mitchell
> On 23 Jun 2016, at 14:27, Jonathan Mitchell wrote: > > The following raises with NSInternalInconsistencyException when : > > 1. an NSArrayController filter is in place, > 2. controller.clearsFilterPredicateOnInsertion = NO > 3. added content object is rejected by the filter. > > Is this beh

NSArrayController - error inserting object at arranged object index N

2016-06-23 Thread Jonathan Mitchell
The following raises with NSInternalInconsistencyException when : 1. an NSArrayController filter is in place, 2. controller.clearsFilterPredicateOnInsertion = NO 3. added content object is rejected by the filter. Is this behaviour by design? #import “AppDelegate.h" @interface AppDelegate () @