Xref: utzoo comp.sys.next:17597 comp.lang.objective-c:257 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!spool.mu.edu!think.com!mintaka!ogicse!pdxgate!eecs.cs.pdx.edu!hal From: hal@eecs.cs.pdx.edu (Aaron Harsh) Newsgroups: comp.sys.next,comp.lang.objective-c Subject: How do you declare class categories which depend on each other? Keywords: categories objective-c Message-ID: <2622@pdxgate.UUCP> Date: 14 May 91 04:17:57 GMT Sender: news@pdxgate.UUCP Reply-To: hal@eecs.cs.pdx.edu (Aaron Harsh) Organization: Portland State University Lines: 47 Is there some way to let the compiler know that a method will be declared in another category? On a class Foo defined like: // Foo.h #import @interface Foo : Object { } - init; @end // Foo.m #import "Foo.h" @implementation Foo : Object - init { [self bar]; return self; } @end // Foo2.m #import "Foo.h" @interface Foo (Foo2) - bar; @end @implementation Foo (Foo2) - bar { puts("BAR"); } @end [[Foo alloc] init] gives the correct output, but the compiler gives the warning: "Foo.m: warning `Foo' does not respond to `bar'". Adding '-bar' to the implementation declaration in Foo.h makes the compiler complain about an incomplete declaration. Does anyone know a way to split up an object declaration without having it complain? Aaron Harsh hal@eecs.cs.pdx.edu