Getting the correct objectValue in NSCell in NSTableView
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