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 > Cocoa Bindings and external data

Cocoa Bindings and external data
Thread Tools
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Aug 10, 2004, 08:47 AM
 
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
Reply With Quote
Aug 10, 2004, 06:03 PM
 
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
Reply With Quote
Aug 10, 2004, 06:15 PM
 
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
Reply With Quote
Aug 10, 2004, 06:37 PM
 
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
Reply With Quote
Aug 11, 2004, 06:33 PM
 
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
     
   
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 01:08 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