Re: Private Methods
Re: Private Methods
- Subject: Re: Private Methods
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 22 Feb 2008 16:10:06 +0100
Le 22 févr. 08 à 15:57, Adhamh Findlay a écrit :
On Feb 22, 2008, at 5:23 AM, email@hidden wrote:
In MyObj.m
@interface MyObj(PrivateStuff)
-(void) aPrivateMethod;
@end;
@implementation MyObj
-(void) aPrivateMethod
{
// Do something
}
-(void) onePublicMethod
{
[self aPrivateMethod];
}
@end
Not to be too picky, but there's an extra semicolon after @end;
@interface MyObj(PrivateStuff)
-(void) aPrivateMethod;
@end
Adhamh
If you want to be picky, I will also add that using a class extension
will be more appropriate, so the compiler will emit a warning if you
do not implements the private methods:
@interface MyObj ()
-(void) aPrivateMethod;
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden