• 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
Re: Global Access Controls ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Global Access Controls ? (From: Chad Eckles <email@hidden>)

  • Prev by Date: Global Access Controls ?
  • Next by Date: Re: Global Access Controls ?
  • Previous by thread: Global Access Controls ?
  • Next by thread: Re: Global Access Controls ?
  • Index(es):
    • Date
    • Thread