Re: cocoa-dev digest, Vol 2 #2921 - 14 msgs
Re: cocoa-dev digest, Vol 2 #2921 - 14 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #2921 - 14 msgs
- From: Simon Stapleton <email@hidden>
- Date: Mon, 15 Sep 2003 17:55:03 +0200
Hi.
What you need, really, is EOF. Post a bugreport to Apple asking for it.
What you'd do if you had EOF is this:
Model your database in EOModeler.
Design your interface in IB
Drag the entity you want from EOModeler to IB
Still in IB, drag a connection from each relevant table column to the
display group for the entity you want to use.
Save interface, compile, run.
ummmm.
Yep, that's about it. And no, you wouldn't need to write any code.
(See .sig for hints on what you can use right now)
Simon
From: Theodore Petrosky <email@hidden>
Subject: Re: help with a tableView dataSource
To: email@hidden
This is still a problem... the issue is the order of
execution.
my main controller class keeps the connection to the
database. a class hold the query and execution with
the methods to access the tableView. my problem is if
I impliment textDidEndEditing: then this gets called
before the tableView datasource has been updated. so
effectively my SQL is stale data.
Is there a way to control the order. I think I need to
use the textDidEndEditing method. but I need to call
it after the datasource is updated.
any clues. ... my head hurts
Ted
--- Tito Ciuro <email@hidden> wrote:
Theodore,
Look at:
http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/
Tasks/UsingTableDataSource.html
In particular:
- (void)tableView:(NSTableView *)tableView
setObjectValue:(id)object
forTableColumn:(NSTableColumn *)tableColumn
row:(int)row;
You can pick the value changed, the column (if
you've set the
tableColumn after a column name) and the row.
Everything you need to
construct your SQL statement.
-- Tito
On Sep 14, 2003, at 3:26 PM, Theodore Petrosky
wrote:
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
--
Objective-C Enterprise Objects resurrected on Mac OS X.
<
http://www.tufty.co.uk/Software/EOPage.html>
--
PGP Key Id : 0x50D0698D
_______________________________________________
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.