• 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: NSTableView behavior changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView behavior changes


  • Subject: Re: NSTableView behavior changes
  • From: Harry Plate <email@hidden>
  • Date: Tue, 17 Mar 2009 17:00:54 -0700
  • Thread-topic: NSTableView behavior changes

Graham,

Finally getting back to this problem.

>>    2) I would like my user to be able to select a table entry, and
>> be able
>> to respond to the 'delete' key - by discarding the selected entry.
>> Currently
>> that does not work at all.
>
> You have to make this happen yourself. The controller that is handling
> the tableview will need to respond to the delete key by finding the
> current selection (i.e. calling -selectedRowIndexes on the tableview),
> deleting the corresponding items from the data model and reloading the
> table view.
>
> To respond to the delete key, the controller will need to subclass
> NSResponder and insert itself as the next responder to the table view
> by calling [tableView setNextResponder:self]; . It then needs to
> override -deleteBackward: or whatever.

So far I have tried to accomplish this without success.

1) I defined my controller class:
    @interface MCController : NSResponder

2) I then defined (void)deleteBackward:(id)

3) in -awakeFromNib, I set my controller as 1st responder:

    [sourceTableView setNextResponder:self]


Sadly,  I do not get to the -deleteBackward: method (Xcode bkpnt).
The ui merely beeps when I hit the 'delete' (backward) key.

Currently the table column are not editable; I tried to make editable, but
that had no effect on the behavior.

I also implemented -acceptsFirstResponder (returning YES); that too did not
change the behavior.

I am obviously barking up the wrong tree. Should I subclass NSTableView, and
intercept keys (keyDown)? I am seeing some list topics where folks have done
that.

Comments welcome,


-harry


_______________________________________________

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

  • Prev by Date: Re: "selector ... is passed a return code and caller specified in contextInfo" ?!?!
  • Next by Date: Re: "selector ... is passed a return code and caller specified in contextInfo" ?!?!
  • Previous by thread: Re: "selector ... is passed a return code and caller specified in contextInfo" ?!?!
  • Next by thread: Re: NSTableView behavior changes
  • Index(es):
    • Date
    • Thread