• 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: DoubleAction in an empty Table...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: CORE DATA, mutableSetValueForKey: on transient properties returns nil ?
  • Next by Date: Re: How to associate a custom NSNotificationCenter with an NSRunLoop in a thread?
  • Previous by thread: DoubleAction in an empty Table...
  • Next by thread: Need of an Apple Engineer. Core-Data Issues
  • Index(es):
    • Date
    • Thread