• 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 and variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: private methods and variables


  • Subject: Re: private methods and variables
  • From: Bill Bumgarner <email@hidden>
  • Date: Wed, 30 Jul 2008 01:02:33 -0700

On Jul 30, 2008, at 12:36 AM, Torsten Curdt wrote:
Even more interesting :) Thanks for sharing that Bill.

I've had another idea: Using a protocol would also be a way of shielding the framework from the implementation details.
The only problem is that class methods are not allowed in a protocol. And the framework's main entry class currently uses a singleton pattern.

Where does it say that protocols can't include class methods? If there is documentation indicating as much then there is a bug somewhere and I'd like to know about it.


The following works as expected -- the compiler complains mightily about the lack of conformance to protocol Bob in class Fred.

@protocol Bob
+ (void) foo;
@end

@interface Fred : NSObject <Bob>
@end
@implementation Fred
@end

---

However, protocols are not generally used to hide implementation details. It sounds more like you want a combination of public and private headers / declarations.

For Cocoa, functionality that is supported is made available through public headers. Functionality that is internal to Cocoa is encapsulated in private headers that declare said private interfaces through a combination of categories, class extensions and full-on class declarations.

b.bum

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: private methods and variables
      • From: Torsten Curdt <email@hidden>
References: 
 >private methods and variables (From: Torsten Curdt <email@hidden>)
 >Re: private methods and variables (From: Ken Thomases <email@hidden>)
 >Re: private methods and variables (From: Torsten Curdt <email@hidden>)
 >Re: private methods and variables (From: "Kyle Sluder" <email@hidden>)
 >Re: private methods and variables (From: Ken Thomases <email@hidden>)
 >Re: private methods and variables (From: Torsten Curdt <email@hidden>)
 >Re: private methods and variables (From: Torsten Curdt <email@hidden>)
 >Re: private methods and variables (From: Ken Thomases <email@hidden>)
 >Re: private methods and variables (From: Torsten Curdt <email@hidden>)
 >Re: private methods and variables (From: Bill Bumgarner <email@hidden>)
 >Re: private methods and variables (From: Torsten Curdt <email@hidden>)

  • Prev by Date: Re: private methods and variables
  • Next by Date: "get" prefixes in Cocoa
  • Previous by thread: Re: private methods and variables
  • Next by thread: Re: private methods and variables
  • Index(es):
    • Date
    • Thread