• 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
Getting the correct objectValue in NSCell in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the correct objectValue in NSCell in NSTableView


  • Subject: Getting the correct objectValue in NSCell in NSTableView
  • From: Ferhat Ayaz <email@hidden>
  • Date: Sat, 19 Apr 2008 23:04:28 +0200

Hi,

I'm implementing the following method in NSActionCell's subclass which I'm using for NSTableColumn dataCell.


- (BOOL)trackMouse:(NSEvent*)theEvent
inRect:(NSRect)cellFrame
ofView:(NSView*)controlView
untilMouseUp:(BOOL)flag
{
NSPoint locationInCell;
locationInCell = [theEvent locationInWindow];
locationInCell = [controlView convertPoint:locationInCell fromView:nil];
NSRect titleRect = [self titleRectForBounds:cellFrame];
if (NSPointInRect(locationInCell, titleRect)) {
NSLog(@"%@", [self objectValue]);
}
return [super trackMouse:theEvent inRect:cellFrame ofView:controlView untilMouseUp:flag];
}



NSLog() logs out the correct objectValue on Leopard.
Unfortunately on Tiger [self objectValue] returns the objectValue associated with the selected row in the NSTableView (populated by an NSArrayController) although I'm clicking a row which is not selected in the NSTableView.


How can I receive the value in the row pointed by locationInCell ?

Thanks,
Ferhat






_______________________________________________

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


  • Prev by Date: Re: presentError:
  • Next by Date: Re: Simulating menu bar blink in Cocoa
  • Previous by thread: Re: presentError:
  • Next by thread: max # of file handles
  • Index(es):
    • Date
    • Thread