 |
 |
Cocoa Bindings and external data
|
 |
|
 |
|
Senior User
Join Date: Feb 2003
Location: USA
Status:
Offline
|
|
I am sure I'm missing something here...I just finally started to learn about bindings, the new controller classes, etc. I have a few sample apps working fine. My question is, how can I make use of this new technology when working with "external" data? I have an app that uses PostgreSQL as its database backend. I send sql queries to the data to retrieve and update data. I keep this data in an array of dictionaries while working with it. How does one tie the data to the array controller?
TIA,
Steve W
|
|
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Originally posted by techtrucker:
I am sure I'm missing something here...I just finally started to learn about bindings, the new controller classes, etc. I have a few sample apps working fine. My question is, how can I make use of this new technology when working with "external" data? I have an app that uses PostgreSQL as its database backend. I send sql queries to the data to retrieve and update data. I keep this data in an array of dictionaries while working with it. How does one tie the data to the array controller?
TIA,
Steve W
So long as you provide key/value coding compliant accessor methods for that data, it should just work. What those accessor methods do (eg, accessing a database) is up to you.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2003
Location: USA
Status:
Offline
|
|
What about the add/delete buttons? I can't just let the app handle that behind the scenes, I have lots I need to do with that data when saving/adding etc.
It seems to me that there still has to be a way to link an array I declare programmatically with the array set up in Interface Builder...
Steve W
|
|
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Originally posted by techtrucker:
What about the add/delete buttons? I can't just let the app handle that behind the scenes, I have lots I need to do with that data when saving/adding etc.
It seems to me that there still has to be a way to link an array I declare programmatically with the array set up in Interface Builder...
Steve W
I think that for the add/delete buttons, you just need to make sure that your init/dealloc methods do any extra work that you want. Add should just create a new object and add it to the array. Delete should simply remove an object from the array (releasing & dealloc'ing it).
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2003
Location: USA
Status:
Offline
|
|
Thanks for the advice, I do appreciate it. But I think I'm sticking with writing "glue code", I know it well.
|
|
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |