Public, private and protected variables
Public, private and protected variables
- Subject: Public, private and protected variables
- From: John MacMullin <email@hidden>
- Date: Sun, 27 Jul 2003 14:55:42 -0700
I have an NSDocument Object that I have subclassed and then I
subclassed the subclass. I have instance variables declared as public
and protected in the first subclass following Cocoa In a Nutshell, page
8, on scoping, as follows:
@public
NSMutableArray *companyRecords;
@protected
NSDictionary *ocAccountsFile;
In my first use in the subclass of the subclass, I am just trying to
get the variables referenced to print using NSLog. I do this by
sending a notification to the subclass. The notification works just
fine. Accessing the variables does not.
- (void)companyInfoTabSelected:(NSNotification *)notification
{
NSLog(@"Notification Action");
NSLog(@"%@-companyRecords", companyRecords);
NSLog(@"%@-ocCategoryFile", ocCategoryFile);
}
The result is:
2003-07-27 14:49:24.453 GLASS[6655] 2 tab view item
2003-07-27 14:49:24.454 GLASS[6655] Notification Action
2003-07-27 14:49:24.454 GLASS[6655] (null)-companyRecords
2003-07-27 14:49:24.454 GLASS[6655] (null)-ocCategoryFile
I have not been able to get the protected and public variables to
print, or be visible in any way, with a number of combinations
including accessor methods. I must be doing something wrong in a
simple way.
Any help would be greatly appreciated.
John
_______________________________________________
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.