3 ms·
Since Objective-C is a superset of C, it also gets compiled in a top-down fashion[1]. if you don't want to add a method to your interface (public or private), j
by Zev 16y ago
Since Objective-C is a superset of C, it also gets compiled in a top-down fashion[1]. if you don't want to add a method to your interface (public or private), just put it above everything else that will use it.
1. I believe there is something about only allowing fir a single pass in the standard, but, don't quote me on it.
- rgbrgb 16y agoYeah, unfortunately you'll get a lot of warnings from Xcode if you do this.
- Zev 16y agoNo you don't. You get warnings about not responding to the method if you put the method implementation after it is used. If it is before, it works fine. Example implementation: @implementation SomeClass - (void) foo { [self baz]; } // a warning will occur; the compiler doesn't know about - baz yet. - (void) bar { [self foo]; } // a warning will not occur; the compiler knows about - foo already. - (void) baz { NSLog(@"bzz"); } // doesn't do anything special @end