Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > TableView editColumn doesn't work?

TableView editColumn doesn't work?
Thread Tools
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status: Offline
Reply With Quote
Dec 7, 2003, 07:47 AM
 
I'm trying to use the editColumn method to go in and automatically start editing a column in a row in a table. However, all it does it select the row (the correct one!) in a gray color, but nothing is selected for editing. I'd expect the selected row to be blue like any other row I select for editing. Here's the two lines of code:

[tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[gbTransactions count]-1] byExtendingSelection:NO];
[tableView editColumn:2 row:[gbTransactions count]-1 withEvent:nil select:YES];

So in the first line I'm selecting the row to edit the column first because if I don't, it returns an error when the app is executing. Note that this makes the row selected in blue like I'd expect! (If I comment out the second line).

In the second line, I want to have the column selected for editing in that row. But instead, it just turns the row highlight gray. Very strange.

Anyone see something I'm doing wrong? This is my first Cocoa app.
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Reply With Quote
Dec 7, 2003, 11:04 AM
 
that method works for me. are you sure you have the right column? (remembering that arrays are zero-based)
     
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status: Offline
Reply With Quote
Dec 11, 2003, 07:49 PM
 
I got it to work - I was calling [self updateUI] after I selected the row and it grays it out.



I didn't expect that behavior and thought I'd HAVE to call it for it to show up.

Either way it works now - thanks for the reply!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:30 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2