Re: Private methods in ObjC
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.