• 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
NSTableView subclass and setDoubleAction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView subclass and setDoubleAction


  • Subject: NSTableView subclass and setDoubleAction
  • From: Todd Ransom <email@hidden>
  • Date: Mon, 21 Jun 2004 15:47:25 -0600

First, I would like to thank everyone who responded to my last
question. Especially mmalc. Between the information about the data
model and your examples for binding controllers, you might as well just
quit what you're working on and write my app.

Now I'm subclassing NSTableView to implement keyboard navigation. I
got the keyboard navigation working fine but I'm trying to implement
"new record on double-click" functionality and I'm not having much
luck.

- (void)awakeFromNib {
[self setTarget:self];
[self setDoubleAction:@selector(addNewRow:)];
}

- (IBAction)addNewRow:(id)sender {
NSLog(@"Double click was detected...");
[myArrayController add:self];
[self selectRowIndexes:
[NSIndexSet indexSetWithIndex:[[myArrayController arrangedObjects]
count] -1]
byExtendingSelection: NO];

}

addNewRow: is never called.

I have also tried setTarget:nil to send the message up the responder
chain and that didn't do it either. I understand setDoubleAction: is
not normally called this way. But is it possible? If not, does it
have to do with @selector? Is there any way I can implement this in an
NSTableView subclass or do I have to call it from my window controller?
I would rather keep all the navigation logic in the subclass so I can
use it multiple apps without too much trouble.

thanks,
TR
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSTableView subclass and setDoubleAction
      • From: Tony Cate <email@hidden>
  • Prev by Date: Re: Dynamic User Interface with Cocoa
  • Next by Date: NSSecureTextField and "Continuously Update Value"
  • Previous by thread: Re: "Modal Session Requires Modal Window" Error
  • Next by thread: Re: NSTableView subclass and setDoubleAction
  • Index(es):
    • Date
    • Thread