• 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: Exception when clicking leftmost header in TableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception when clicking leftmost header in TableView


  • Subject: Re: Exception when clicking leftmost header in TableView
  • From: Nicola Vitacolonna <email@hidden>
  • Date: Thu, 11 Apr 2002 17:25:43 +0200

> Yes, you'll need to check to see if the clickedRow returns (-1). That
> is NSTableView's way of saying that NO row was selected.

Ok, in my own method I check whether clickedRow returns -1 and I have
no problem (I report my code below just for reference). The exception is
raised *only* when clicking on the two or three leftmost pixels of the
leftmost header, and in that case my method is *not* called at all, as
isn't any other delegate I implemented (such as
shouldSelectTableColumn:). Instead, if I click in any other point of the
header, everything goes fine.

- (void)handleClickOnTableItem {
int column, row;

column = [theTable clickedColumn];
row = [theTable clickedRow];

if ([[[[theTable tableColumns] objectAtIndex:column] identifier]
isEqual:@"Leftmost Column"]) {
if (row > -1) { // If row == -1, the user clicked outside cells
[...]
}
}
}


> I have another follow-up to the previous question that has a bit more
> sample code in it for handling this. (Not that I'm saying it's the best
> code, mind you. Aren't we ALL learning?).
>
> Christopher
>
> On Thursday, April 11, 2002, at 09:50 AM, Nicola Vitacolonna wrote:
>
>> I have noticed the following strange behaviour in a TableView: when
>> clicking near
>> the left edge of the leftmost header, the following exception is
>> raised,
>> which I am not able
>> to intercept and debug:
>>
>> 2002-04-11 16:36:13.878 MyApp[648] *** -[NSCFArray objectAtIndex:]:
>> index (-1) beyond bounds (5)
>>
>> As suggested in a reply to my previous mail ("How to detect single
>> mouse
>> click in a TableView?")
>> I setup
>>
>> [theTable setAction:@selector(handleClickOnTableItem:)];
>>
>> but my own handleClickOnTableItem is not called when I click over those
>> two or three leftmost pixels. In every other case it is. (Actually, I
>> noticed that it is not called when I click near the edges of every
>> header, but only the leftmost raises the exception, while in the other
>> cases nothing happens).
>>
>> Is it a bug or am I missing some check? Should I just ignore the
>> exception?
>>
>> Regards,
>> Nicola
>>
>> ** ** Get my PGP public key at:
>> ** * ** * www.dimi.uniud.it/~vitacolo
>> ** * ** * or finger email@hidden
>> ** * Universita' degli Studi di Udine
>> * ***icola Vitacolonna
>>
>> [demime 0.98b removed an attachment of type application/pgp-signature
>> which had a name of PGP.sig; charset=US-ASCII]
>> _______________________________________________
>> 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.
>
>
** ** Get my PGP public key at:
** * ** * www.dimi.uniud.it/~vitacolo
** * ** * or finger email@hidden
** * Universita' degli Studi di Udine
* ***icola Vitacolonna

[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig; charset=US-ASCII]
_______________________________________________
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: Exception when clicking leftmost header in TableView
      • From: Andy Lee <email@hidden>
References: 
 >Re: Exception when clicking leftmost header in TableView (From: Christopher Holland <email@hidden>)

  • Prev by Date: dblib
  • Next by Date: Re: dblib
  • Previous by thread: Re: Exception when clicking leftmost header in TableView
  • Next by thread: Re: Exception when clicking leftmost header in TableView
  • Index(es):
    • Date
    • Thread