• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Private Methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Private Methods (From: Philip Bridson <email@hidden>)
 >Re: Private Methods (From: email@hidden)
 >Re: Private Methods (From: Adhamh Findlay <email@hidden>)

  • Prev by Date: Re: Private Methods
  • Next by Date: Re: Simple Core Data Binding Question: NSTextField to Integer attribute
  • Previous by thread: Re: Private Methods
  • Next by thread: Re: Private Methods
  • Index(es):
    • Date
    • Thread