Re: NSArrayController selection bug?
Re: NSArrayController selection bug?
- Subject: Re: NSArrayController selection bug?
- From: mmalcolm crawford <email@hidden>
- Date: Mon, 10 Nov 2003 15:39:51 -0800
On Nov 10, 2003, at 2:59 PM, Henrik Wittland wrote:
- (IBAction)modelRemove:(id)sender {
NSMutableArray *c = [NSMutableArray arrayWithArray:[self
contentArray]];
[c removeObjectAtIndex:0];
[self setArray:c];
}
I think in your case this workaround should help but if you would
declare your interface like this :
@interface MyDocument : NSDocument {
...
NSArray *contentArray;
...
}
...
- (NSArray *)contentArray;
- (void)setContentArray:(NSArray *)array;
...
@end
It's not only a workaround but the right way to go.
Um, sorry, but no it's not the right way to go.
There is no need to replace the whole array each time. The current
best approach is to use the mutable array accessors.
(I'll take a look at Jesse's example anon.)
mmalc
_______________________________________________
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.