help with a tableView dataSource
help with a tableView dataSource
- Subject: help with a tableView dataSource
- From: Theodore Petrosky <email@hidden>
- Date: Sun, 14 Sep 2003 06:26:02 -0700 (PDT)
I have a table that has a 'normal' array of dictionary
objects as its source. I am using the normal
objectValueForTableColumn and setObject to populate
the table and setObjectValue to update the data
source.
my problem is that the array is not the final resting
place... I populate the array from a postgresql
database. so my order of event is..
1. get data rows from db
2. create the array of dictionay objects from database
3. populate the table
4. on update of a (row, column) let the normal
setObjectValue update the datasource.
5. pick up the index of the changed row and find it in
the array to create the sql to update the db.
here's the problem.. when to fire my code to update
the db. I have tried tableViewSelectionIsChanging and
tableViewSelectionDidChange
I have tried to maintain an instance variable with the
row number textDidChange, then when
tableViewSelectionDidChange since I have the row index
of the row that was being edited, use it to create the
sql.
It appears that tableViewSelectionDidChange is firing
before the datasource is internally updated.
I need some ideas. I need to update the db. I am
starting to think I need to put the changed text into
a instance variable. Just let the system maintain
itself and not try to get the values from the array.
OK I just tried to have the tableView respond to the
textDidChange notification. I think this could work.
as text is 'changing' in the tableView I am updating
an instance variable. problem is that as you type in
the textField in the tableView, nothing shows on the
screen. I see that insertion point moving as if i were
typing spaces. When i click off or tab away, the
correct text is displayed.
Or am I barking up the wrong tree. Someone must have
experience with this kind of thing.
I have spent too much time on this......
Ted
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
_______________________________________________
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.