Re: Pre declaration of methods
Re: Pre declaration of methods
- Subject: Re: Pre declaration of methods
- From: Sherm Pendley <email@hidden>
- Date: Sun, 6 Apr 2003 11:44:49 -0400
On Sunday, April 6, 2003, at 11:09 AM, Jirtme Paschoud wrote:
I just didn't put the methods declarations in the header of the
class. But when I do that if I'm using a "firstMethod" that calls a
"secondMethod" that is a few lines down, I'm getting a:
warning: `myClass' does not respond to `secondMethods'
But the code compile sucessfully and works as expected.
Is that possible to pre declare "secondMethod" so I can write my class
in a
logical order and not in a "methods call priority order".
Yes - declare your private methods separately, as a category.
For example; assuming you have declared your public methods elsewhere,
you could declare a "PrivateMethods" category for your private methods
like this:
@interface MyClass(PrivateMethods)
// Method declarations here...
@end
You can put this additional interface at the top of the .m file, or in a
separate header file - whatever suits your purposes best.
sherm--
C programmers never die - they're just cast into void.
_______________________________________________
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.