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

Re: Private methods in ObjC


  • Subject: Re: Private methods in ObjC
  • From: Troy Dawson <email@hidden>
  • Date: Wed, 25 Feb 2004 15:07:41 -0800

5. Any funky techniques like multiple interface declarations?

I have an idiomatic technique that the compiler stopped complaining about yesterday, even for derived classes... heheh maybe I should patent it.


In the MyObject.h:

@protocol MyObjectPublicInterface
- (void) foo;
@end

typedef NSObject<MyObjectPublicInterface> MyObject;

namespace MyObjectFactory
{
MyObject* Create();
}

In the MyObject.mm:

@interface MyObjectPrivate : NSObject<MyObjectPublicInterface>
{
}
- (void) bar;
@end

@implementation MyObjectPrivate

- (void) foo { }
- (void) bar { }

@end

MyObject* MyObjectFactory::Create()
{
return [[[MyObjectPrivate alloc] init] autorelease];
}
_______________________________________________
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.


References: 
 >Private methods in ObjC (From: Glen Low <email@hidden>)

  • Prev by Date: Re: NSArrayController and bindings
  • Next by Date: Re: NSArrayController and bindings
  • Previous by thread: Re: Private methods in ObjC
  • Next by thread: Re: Private methods in ObjC
  • Index(es):
    • Date
    • Thread