Re: Categories and Compiler Warnings
Re: Categories and Compiler Warnings
- Subject: Re: Categories and Compiler Warnings
- From: Ondra Cada <email@hidden>
- Date: Fri, 28 May 2004 12:33:51 +0200
Daniel,
On 28.5.2004, at 8:29, Daniel Todd Currie wrote:
>
> @implementation MyClass
>
> [...]
>
> @end
>
>
>
> @interface MyClass (Private)
>
> - (void)myPrivateMethod;
>
> @end
>
>
>
> @implementation MyClass (Private)
>
> - (void) myPrivateMethod {
>
> [...]
>
> }
>
> @end
>
>
The problem is that whenever I call myPrivateMethod from the
>
public/primary MyClass implementation, I get one of those annoying
>
"may not respond to" compiler warnings. What is the point of even
>
having an interface if I still get warnings?
What is the point of declaring an interface if you don't give it to the
compiler?
Try to put the interface into a header which is imported before the
interface is used. If it is private for MyClass, switch the order so
that the compiler knows of it at the time it compiles the MyClass
implementation:
@interface MyClass (Private) ... // MUST be before...
@implementation MyClass ... // this, self-evidently: how other should
the compiler know?!?
@implementation MyClass (Private) ... // this can be above or below:
unimportant
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.