Copying an NSPopUpButton
Copying an NSPopUpButton
- Subject: Copying an NSPopUpButton
- From: Martin Linklater <email@hidden>
- Date: Sun, 12 Aug 2007 16:43:34 +0100
Hi - I'm a newb with Cocoa so please bare with me...
I have two classes in my application - an AppController and a Cpu.
The AppController has a member variable
IBOutlet NSPopUpButton* button;
which is bound to my GUI using Interface builder.
I want to get and set the items in the NSPopUpButton from the Cpu
class, so I have added a pointer along with it's associated setter
and getter. I have tried to create a set method as follows:
// cpu.m
-(void)setButton:(NSPopUpButton*)button
{
[myButton release];
myButton = [button copy];
[button release];
}
but the compiler complains that there is no 'copy' method for
NSPopUpButton. Since this class does not conform to NSCopying that's
fair enough. But how then do I copy the pointer while maintaining
reference counting etc. ?
Again, sorry for the newb question - I just want to get at what I'm
doing fundamentally wrong...
Thanks.
_______________________________________________
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