• 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: Henrik Wittland <email@hidden>
  • Date: Tue, 11 Nov 2003 00:52:28 +0100

Am 11.11.2003 um 00:39 schrieb mmalcolm crawford:


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.

Hello mmalc,
i think its the right way to go when you choos to work with an immutable API. If you choose to go with a mutable API
it's only a workaround (as said).
With the mutable API it's the right way to implement the array accessors, but then there is the described BUG.

Or short : If the array pointer is not changing then the NSArrayController has a selection bug if it should "preserves selection".

(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.

References: 
 >NSArrayController selection bug? (From: Jesse Grosjean <email@hidden>)
 >Re: NSArrayController selection bug? (From: Henrik Wittland <email@hidden>)
 >Re: NSArrayController selection bug? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: NSArrayController selection bug?
  • Next by Date: Re: Updating the main menu
  • Previous by thread: Re: NSArrayController selection bug?
  • Next by thread: No man pages when installing xcode?
  • Index(es):
    • Date
    • Thread