Re: ObjC's flat and all-exported namespace, help!
Re: ObjC's flat and all-exported namespace, help!
- Subject: Re: ObjC's flat and all-exported namespace, help!
- From: Andreas Grosam <email@hidden>
- Date: Wed, 09 Nov 2011 11:26:17 +0100
On Nov 9, 2011, at 10:11 AM, Karl Goiser wrote:
> .. so if you prefix all your classes with your company name, the only conflicts will be with the same class from different bundles, which means that only one instance of any class will be loaded, thus saving memory on every client’s machine…
>
> Yes?
It seems, you like this:
// File: com_example_company_appsuite_Bar.m
// private class
@interface com_example_company_appsuite_Bar_detail_Foo
@end
…
@implementation com_example_company_appsuite_Bar
// private method
- (void) doSomethingWithFoo:(com_example_company_appsuite_Bar_detail_Foo*) foo
{
com_example_company_appsuite_Bar_detail_Foo* fooCopy = [foo copy];
...
}
Where it **could** look like this:
namespace example_company { namespace appsuite {
namespace Bar_detail {
@interface Foo
@end
...
}
@implementation Bar
using Bar_detail::Foo;
// private method
- (void) doSomethingWithFoo:(Foo*) foo
{
Foo* fooCopy = [foo copy];
...
}
}}
Andreas
_______________________________________________
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