• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: complicated (I think) Binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: complicated (I think) Binding
      • From: Ryan Britton <email@hidden>
    • Re: complicated (I think) Binding
      • From: mmalcolm crawford <email@hidden>
References: 
 >complicated (I think) Binding (From: Mike Abdullah <email@hidden>)
 >Re: complicated (I think) Binding (From: John Pannell <email@hidden>)
 >Re: complicated (I think) Binding (From: Mike Abdullah <email@hidden>)
 >Re: complicated (I think) Binding (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: NSLog(@"%@",[NSProxy class]);
  • Next by Date: Re: complicated (I think) Binding
  • Previous by thread: Re: complicated (I think) Binding
  • Next by thread: Re: complicated (I think) Binding
  • Index(es):
    • Date
    • Thread