Re: complicated (I think) Binding
Re: complicated (I think) Binding
- Subject: Re: complicated (I think) Binding
- From: Mike Abdullah <email@hidden>
- Date: Sun, 12 Mar 2006 01:25:24 +0000
I've managed to solve the thing in the end. Mmalcolm, you're right,
I was a bit of an idiot not to have considered the NSArrayController!
I have bound it to delegate.systemSounds of Shared Application and
this seems to be doing the job nicely. Since this array should never
change its value once the application is running, I have bound the
selectedIndex of the popup button to my data object. When it is time
for my app to extract the alarm (this should only happen once for
each document in this particular case), I will have it look up the
associated filename from the systemSounds array.
Thanks very much guys,
Mike.
On 12 Mar 2006, at 00:16, mmalcolm crawford wrote:
On Mar 11, 2006, at 4:00 PM, Mike Abdullah wrote:
From your solution, I have a question. You say to bind to
selectedValue to the popup button, but that it will give me the
result minus the extension. What if I were to bind to
selectedObject instead? (I am still trying to learn what these
various options are actually for!
Binding options are documented here:
<http://developer.apple.com/documentation/Cocoa/Reference/
CocoaBindingsRef/>
An example of a pop-up list using bindings is given here:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
(see "To-Dos").
I think the key point may be that I need a NSArrayController, I
hadn't really considered using one for this situation previously.
It's not clear why you would not consider the use of an array
controller to manage an array?
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden