Custom PopUpButton problems
Custom PopUpButton problems
- Subject: Custom PopUpButton problems
- From: Adam Raney <email@hidden>
- Date: Wed, 5 Oct 2005 15:41:06 -0500
Hello all,
I have created a custom popup button (ACRPopUpButton) that has an
instance variable called "targetTextField". My goal is to have the
user be able to pick from an item from the popup's menu and to have
that item placed in the targetTextField.
I have placed the popup button in Interface Builder and connected a
text field to it's targetTextField: . I have also placed a method in
my controller called insert: that is called from the popup button.
Here's the various code I'm using for this:
-----
ACRPopUpButton.m:
#import "ACRPopUpButton.h"
@implementation ACRPopUpButton
- (NSTextField *) targetTextField
{
return targetTextField;
}
@end
-----
Controller :
- (IBAction)insert:(id)sender
{
NSTextField * targetField = [sender targetTextField];
[targetField setStringValue: @"INSERT"];
}
-----
I have run this in the debugger, and the insert: method is being
called. The problem seems to be that the pop up is not returning a
true pointer to the text field. The NSTextField * targetField
variable is defined as struct NSTextField * in the debugger both
before and after the assignment.
What have I done wrong here? What needs to be changed to return a
proper reference to the text field so I can set it's string value?
_______________________________________________
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