• 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's "selectionIndex" weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController's "selectionIndex" weirdness


  • Subject: Re: NSArrayController's "selectionIndex" weirdness
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 10 Apr 2008 19:37:15 -0700


On Apr 10, 2008, at 19:09, Johnny Lundy wrote:

- (void) nightKill:(NSUInteger) theWhackedOne
{
	NSLog(@"SelectionIndex=%@",theWhackedOne);
	[playerArray removeObjectAtIndex:theWhackedOne];
	return;
}

The array controller is sending you a NSNumber whose value is the selection index. That's why it NSLogs correctly with the %@ (object) format specifier.


You need:

- (void) nightKill:(NSNumber *) theWhackedOne
{
	NSLog(@"SelectionIndex=%@",theWhackedOne);
	[playerArray removeObjectAtIndex:[theWhackedOne integerValue]];
	return;
}


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSArrayController's "selectionIndex" weirdness (From: Johnny Lundy <email@hidden>)

  • Prev by Date: Re: Question about NSTreeController/NSOutlineView instance cleanup
  • Next by Date: Re: Question about NSTreeController/NSOutlineView instance cleanup
  • Previous by thread: NSArrayController's "selectionIndex" weirdness
  • Next by thread: Re:NSArrayController's "selectionIndex" weirdness
  • Index(es):
    • Date
    • Thread