• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController selection bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSArrayController selection bug?
      • From: Henrik Wittland <email@hidden>
References: 
 >NSArrayController selection bug? (From: Jesse Grosjean <email@hidden>)
 >Re: NSArrayController selection bug? (From: Henrik Wittland <email@hidden>)

  • Prev by Date: Re: NSArrayController selection bug?
  • Next by Date: Re: NSArrayController selection bug?
  • Previous by thread: Re: NSArrayController selection bug?
  • Next by thread: Re: NSArrayController selection bug?
  • Index(es):
    • Date
    • Thread