• 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
Class method not working. Why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Class method not working. Why?
      • From: Phillip Morelock <email@hidden>
  • Prev by Date: Re: communicating with other applications
  • Next by Date: Re: Class method not working. Why?
  • Previous by thread: Re: How to open a new document/window...
  • Next by thread: Re: Class method not working. Why?
  • Index(es):
    • Date
    • Thread