I've got a column of buttons in a tableView.  I don't allow multiple
row selections.

A click of the button fires a method which says.....

id obj;
obj=[[anArrayController selectedObjects] objectAtIndex:0];
NSLog(@"the object: %@",obj);

If I don't pre-select the row, it takes two clicks of the button to
register the correct object.  The first click will register the
previously selected row.  It's like the button is at a higher priority
than the selected row.

To solve the problem, I did the following.....

int clickedRow=[theTableView clickedRow];
id obj=[[theTableViewArrayController
arrangedObjects]objectAtIndex:clickedRow];

This solved the problem....

But why?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to