• 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
How do I Bind Radio Buttons (NSMatrix) with a single NSTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I Bind Radio Buttons (NSMatrix) with a single NSTextField?


  • Subject: How do I Bind Radio Buttons (NSMatrix) with a single NSTextField?
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Fri, 30 Dec 2005 15:34:29 -0800

I want to reduce my code using bindings: to bind NSMatrix (radio buttons) with a NSTextField.
That is, I want to bind a radio button's description with a common name/description NSTextField.

Hence each radio button is associated with a value shown in the NSTextField, initially populated by default values.

...The NSTextField's value changes/radio button selected.

{Radio Buttons} <--- NSMutableDictionary ---> {single NSTextField shared by all buttons}

Here's the scenario:

Radio Buttons (with their example NSTextField values):
Region (tag: 0) --- > "Europe"
Country (tag: 1) ---> "France"
SubRegion (tag: 2) ---> "Central"
City (tag: 3) ---> "Paris"

Initial NSMutableDictionary value:

[self setNewRegionNames:[NSMutableDictionary dictionaryWithObjectsAndKeys:
gvDefaultRegion,@"region",
gvDefaultCountry,@"country",
@"",@"subregion",
@"",@"city", nil]];

=============
Bindings:

NSArrayController:
Attributes:
Object Class Name: NSMutableDictionary.
Key: name (NSString)

contentObject: newRegionNames {NSMutableDictionary}

---------------------------

NSTextField Binding:

Value = selection.name(NSArrayController)

---------------------------

NSMatrix (radio buttons):

selectedTag: NSArrayController <-- Value Selection

==================

I got the following Build Error (due to the NSMatrix binding):

2005-12-30 15:13:59.799 Global Village[2185] Cannot create int from object <_NSControllerObjectProxy: 0x3ec570> of class _NSControllerObjectProxy

===================

1) What am I missing?
2) How do I sync controller modifications (fudging/data processing) of fields with the NSArrayController binding?


Ric.

_______________________________________________
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
  • Prev by Date: Re: Memory Management
  • Next by Date: ZeroLink symbols and frameworks
  • Previous by thread: Re: Memory Management
  • Next by thread: ZeroLink symbols and frameworks
  • Index(es):
    • Date
    • Thread