• 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: Signed incoherences with NSTableView indexes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Signed incoherences with NSTableView indexes


  • Subject: Re: Signed incoherences with NSTableView indexes
  • From: "R. Matthew Emerson" <email@hidden>
  • Date: Tue, 17 Oct 2006 10:11:29 -0400


On Oct 17, 2006, at 6:56 AM, Stephane wrote:

It looks like that there are some incoherences in the way NSTableView deals with selection (from a signed/unsigned point of view).

If you need to find the currently selected row, the recommended API is:

- (int) selectedRow;

If you need to find the currently selected rows, the recommended API is:

- (NSIndexSet *) selectedRowIndexes;

Considering that a NSIndexSet only deals with "unsigned int" (according to the header and documentation), this results in a strange situation where an index is either an int or an unsigned int.

Wouldn't it be possible to only use "unsigned int" in the API definitions?

You would, of course, need some other way for selectedRow to indicate that there is no row selected if it returned an unsigned int. (selectedRow returns -1 if no row is selected).


unsigned index;
int r = [tv selectedRow];

if (r != -1)
  index = (unsigned)r;

Not exactly beautiful, I agree, but I guess we've got art and museums and stuff for that. :-/

(please note ironic smiley)



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Signed incoherences with NSTableView indexes
      • From: Martin Wierschin <email@hidden>
References: 
 >Signed incoherences with NSTableView indexes (From: Stephane <email@hidden>)

  • Prev by Date: Re: Re: Error with [pluginBundle infoDictionary]
  • Next by Date: Re: keypress events + responder chain
  • Previous by thread: Signed incoherences with NSTableView indexes
  • Next by thread: Re: Signed incoherences with NSTableView indexes
  • Index(es):
    • Date
    • Thread