Re: DoubleAction in an empty Table...
Re: DoubleAction in an empty Table...
- Subject: Re: DoubleAction in an empty Table...
- From: Conor Dearden <email@hidden>
- Date: Wed, 29 Mar 2006 12:26:05 +0200
> I thought it would be fine, to provide my newRecord method in a similar
> way, by invoking it, if a user double-clicks an empty tableor unused row.
> Therefore I read the documentation on NSTableView, NSControl and NSResponder
> over and over, but still can't figure out, how this could be accomplished.
> Is there anybody, who could help me with this?
Hi Peter,
You will find that your setDoubleAction method still gets called when a user
double clicks an empty row. What you need to do is check the table for a
selection at the beginning of that function and if there is no selection
call your newRecord method.
- (IBAction)editRecord:(id)sender {
if ([myTableView numberOfSelectedRows] == 0) {
[self newRecord:sender];
return;
}
//We edit here
}
Regards,
Conor Dearden
http://www.bruji.com/
_______________________________________________
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