• 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
NSPopUpButton again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPopUpButton again


  • Subject: NSPopUpButton again
  • From: Johnny Lundy <email@hidden>
  • Date: Thu, 8 May 2008 21:56:46 -0400

Hi, still having no luck with NSPopUpButton and getting the selected item in the popup back into my model string.

Simplified down to the bone, here's my class Popup:

//  Popup.h
//  TestPopup

#import <Cocoa/Cocoa.h>
@interface Popup : NSObject
{
	NSArray *popupArray;
	NSString *selectedGame;
}
- (void) debug;
@property (readwrite, copy) NSArray *popupArray;
@property (readwrite, copy) NSString *selectedGame;
@end



//  Popup.m
//  TestPopup

#import "Popup.h"

@implementation Popup: NSObject
@synthesize popupArray;
@synthesize selectedGame;

- (void) awakeFromNib
{
	[self setPopupArray: [NSArray arrayWithObjects:@"C9", @"F11", nil]];
	[self setSelectedGame:@""];
}
- (void) debug //Something to set a breakpoint on
{
	return;
}
@end

Bindings:
1. My NSPopUpButton is bound with its Content, Content Objects, and Content Values to the NSArrayController's arrangedObjects.self.


2. The NSArrayController's Content is bound to Popup.popupArray through an instance of the class Popup in IB (see #3).

3. An NSObject "popup", instantiated from within IB, has its Class set to "Popup." Binding to that to get the array content works fine (popup.popupArray).

I can't figure out what to bind the NSPopUpButton's "selection" bindings to, to get the instance variable "selectedGame" to be set to whichever of the two items in the popup is selected by the user.

I have read all 400+ messages on this list about NSPopUpButton, and watched the WWDC session (I'm a Select member of ADC) on bindings.

View-Controller-Model. I want the selection of the popup to set the model string "selectedGame." That's all I need.

Can anyone help?
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSPopUpButton again
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Quadratic curves in NSBezierPath
  • Next by Date: Superview and Subview Implementation Question
  • Previous by thread: Re: F-Script Anywhere can't add to procmod group
  • Next by thread: Re: NSPopUpButton again
  • Index(es):
    • Date
    • Thread