Re: Global Access Controls ?
Re: Global Access Controls ?
- Subject: Re: Global Access Controls ?
- From: Greg Hulands <email@hidden>
- Date: Fri, 25 Apr 2003 10:31:20 +1000
You will need to have a reference to MyClass in MyClass2 so you can
access txtName. Have an accessor in MyClass called setTxtName which
will then set the text fields string value. Or you could make the
txtName a global variable and add it to the view in you nib
programmically and have it an extern in your MyClass2.
Greg
On Friday, April 25, 2003, at 10:06 AM, Chad Eckles wrote:
Hello I have a control that i want to define only onece and i want to
be
able to use it in other classes without having to redefine it over an
over
an over again how can i do this ?
E.g
I have MyClass with a Defined NSTextField and in MyClass2 i want to be
able
to access that NSTextField with out having to redefine it ?
/* MyClass */
#import <Cocoa/Cocoa.h>
@interface MyClass : NSObject
{
IBOutlet NSTextField *txtName;
}
@end
/* MyClass2 */
#import <Cocoa/Cocoa.h>
@interface MyClass2 : NSObject
{
}
-(void)awakeFromNib
{
[txtName setStringValue:@"Helllo"];
}
@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.