Adding a new row to a NSTextView for editing (user input).
Adding a new row to a NSTextView for editing (user input).
- Subject: Adding a new row to a NSTextView for editing (user input).
- From: "Frederick C. Lee" <email@hidden>
- Date: Sun, 30 May 2004 17:06:56 -0700
Greetings:
I wish to allow the user to add a row to a NSTableview and enter data
per column. The following code snippet works for a table of cities.
However, the [table selectRow.....] statement has been deprecated as of
Panther.
1) How do I employ its replacement: [table selectRowIndexes.....]? I
wish to select the last row (the added row) for user input.
-------------
int newRow = [table numberOfRows]; // current count is index of next
available row
// Create empty record at end of model array with a unique ID.
[self newCityRecord];
[cityTable_View reloadData];
// Select a cell in the new row for editing.
[table selectRow:newRow byExtendingSelection:NO]; // Deprecated as of
Panther.
vs.
Is the following okay?
[table selectRowIndexes: (NSIndexSet *)newRow
byExtendingSelection:NO]; // Apple suggests using this instead per
literature.
---------------
Casting 'newRow' (int) into (NTIndexSet *) compiled okay with no
runtime errors. But I don't see the new row selected.
In short, I believe I need a way to convert the 'numberOfRows' to a
specific index position.
But I'm getting lost here.
_______________________________________________
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.