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 > Double bindings?

Double bindings?
Thread Tools
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Aug 6, 2005, 09:54 AM
 
Hello. I'm very much a Cocoa n00b so I thought maybe you guys could help me with this.

In an app I'm working on there is an NSTableView that contains Gizmos. I have successfully setup an NSArrayController with bindings to manage the Gizmos contained within this table. I have buttons that properly add and remove new Gizmos. I also have an NSUserDefaultsController setup that successfully manages some simple global settings.

Here's what I can't figure out: How can I get my NSMutableArray of Gizmos that is managed by the NSArrayController to also be automagically saved in the prefs by NSUserDefaultsController? I would like to be able to, for instance, add a new Gizmo with the button linked to NSArrayController's add: action, change the Gizmo's name in the table, quit the app, and then find that same Gizmo in the table again the next time I launch the app.
     
techtrucker
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Aug 6, 2005, 05:31 PM
 
You should (I think) be able to save an immutable copy of the array in user defaults and read it back in upon application launch. As far as capturing immediate edits in a table view I have used controlTextDidEndEditing with some success...
But I cannot speak how this all relates to Bindings, I haven't worked with them at all.
( Last edited by techtrucker; Aug 6, 2005 at 05:34 PM. Reason: syntax error)
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
Top
Privacy Policy
All times are GMT -4. The time now is 01:52 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,