Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 159999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:57:26+00:00 2026-05-11T10:57:26+00:00

Is it possible to navigate an NSTableView’s editable cell around the NSTableView using arrow

  • 0

Is it possible to navigate an NSTableView’s editable cell around the NSTableView using arrow keys and enter/tab? For example, I want to make it feel more like a spreadsheet.

The users of this application are expected to edit quite a lot of cells (but not all of them), and I think it would be easier to do so if they didn’t have to double-click on each cell.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:57:27+00:00Added an answer on May 11, 2026 at 10:57 am

    Well it isn’t easy but I managed to do it without having to use RRSpreadSheet or even another control. Here’s what you have to do:

    1. Create a subclass of NSTextView, this will be the field editor. For this example the name MyFieldEditorClass will be used and myFieldEditor will refer to an instance of this class.

    2. Add a method to MyFieldEditorClass called ‘- (void) setLastKnownColumn:(unsigned)aCol andRow:(unsigned) aRow‘ or something similar, and have it save both the input parameter values somewhere.

    3. Add another method called ‘setTableView:’ and have it save the NSTableView object somewhere, or unless there is another way to get the NSTableView object from the field editor, use that.

    4. Add another method called - (void) keyDown:(NSEvent *) event. This is actually overriding the NSResponder‘s keyDown:. The source code should be (be aware that StackOverflow’s MarkDown is changing < and > to &lt; and &gt;):

      - (void) keyDown:(NSEvent *) event {     unsigned newRow = row, newCol = column;     switch ([event keyCode])     {         case 126: // Up             if (row)             newRow = row - 1;             break;          case 125: // Down             if (row < [theTable numberOfRows] - 1)                 newRow = row + 1;             break;          case 123: // Left             if (column > 1)                 newCol = column - 1;             break;          case 124: // Right             if (column < [theTable numberOfColumns] - 1)                 newCol = column + 1;             break;          default:             [super keyDown:event];             return;     }      [theTable selectRow:newRow byExtendingSelection:NO];     [theTable editColumn:newCol row:newRow withEvent:nil select:YES];     row = newRow;     column = newCol; } 
    5. Give the NSTableView in your nib a delegate, and in the delegate add the method:

      - (BOOL) tableView:(NSTableView *)aTableView shouldEditColumn:(NSTableColumn *) aCol row:aRow {     if ([aTableView isEqual:TheTableViewYouWantToChangeBehaviour])         [myFieldEditor setLastKnownColumn:[[aTableView tableColumns] indexOfObject:aCol] andRow:aRow];     return YES; } 
    6. Finally, give the Table View’s main window a delegate and add the method:

      - (id) windowWillReturnFieldEditor:(NSWindow *) aWindow toObject:(id) anObject {     if ([anObject isEqual:TheTableViewYouWantToChangeBehaviour])     {         if (!myFieldEditor)         {             myFieldEditor = [[MyFieldEditorClass alloc] init];             [myFieldEditor setTableView:anObject];         }         return myFieldEditor;     }     else     {         return nil;     } } 

    Run the program and give it a go!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 102k
  • Answers 102k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You don't have to but its not a bad idea.… May 11, 2026 at 8:12 pm
  • Editorial Team
    Editorial Team added an answer It is possible that your destination is an invalid path… May 11, 2026 at 8:12 pm
  • Editorial Team
    Editorial Team added an answer PHP FTP Example I'm not familiar with your order info… May 11, 2026 at 8:12 pm

Related Questions

Is it possible to navigate an NSTableView's editable cell around the NSTableView using arrow
I have an application which pulls XAML page paths from a database. I can
Is it possible to save ViewState information, e.g. to session, so that when you
A cancer CT picture is stored inside a unsigned short array (1-dimensional). I have
I'm wondering if it's possible to capture details from the web page that a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.