Re: Getting a variable from another class
Re: Getting a variable from another class
- Subject: Re: Getting a variable from another class
- From: Ofri Wolfus <email@hidden>
- Date: Tue, 14 Mar 2006 12:41:37 +0200
First, RAID.m is not a class. It's an implementation file :-P
You can declare public ivars using the @public keyword like this
(typed in mail):
@interface MyObject {
NSString *name; //This variable is protected.
@public
NSString *publicName; //This variable is public, and can be accessed
directly by anyone
}
@end
You can also use the @defs() directive in order to access private/
protected ivars but it is not recommended in most cases.
Hope this helps,
- Ofri
On 14/03/2006, at 12:05, Matthew Egan wrote:
This is a Cocoa 101 question but ...
Say I have two classes -
RAID.m and RAIDstatus.m
And I have a variable in RAID.m that holds a color.
How do I get RAIDstatus.m to find out what is in that variable,
held in another class (RAID.m) ?
Is it possible to get the contents of a variable from another class?
Thanks
Matt Egan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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