Class method not working. Why?
Class method not working. Why?
- Subject: Class method not working. Why?
- From: Ken Tozier <email@hidden>
- Date: Sat, 22 Jun 2002 14:37:46 -0400
I wrote a class method to cash the root object for my outline view and
keep getting warnings when I go to run the project. Anyone out there
point out what I'm doing wrong?
Defined in "Foo.h"
+(id) rootObject;
Defined in "Foo.m"
+ (id) rootObject
{
static Foo *rootObject = nil;
if (rootObject == nil)
{
rootObject = [[self alloc] init];
}
return rootObject;
}
And I get the following warning when I go to run it ...
"warning: Foo does not respond to rootObject"
... in these lines of code
[newWidget setParent:[self rootObject]];
[[[self rootObject] childList] addObject: newWidget];
NSEnumerator *widgetEnumerator = [[[self rootObject] childList]
objectEnumerator];
Thanks for any help
Ken Tozier
_______________________________________________
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.