• 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: ObjC's flat and all-exported namespace, help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: ObjC's flat and all-exported namespace, help!
      • From: Karl Goiser <email@hidden>
References: 
 >ObjC's flat and all-exported namespace, help! (From: Andy O'Meara <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: Greg Parker <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: Ian Joyner <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: Jean-Daniel Dupas <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: John Joyce <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: Karl Goiser <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: Andy O'Meara <email@hidden>)
 >Re: ObjC's flat and all-exported namespace, help! (From: Karl Goiser <email@hidden>)

  • Prev by Date: Re: ObjC's flat and all-exported namespace, help!
  • Next by Date: Re: Changing the appearance of buttons
  • Previous by thread: Re: ObjC's flat and all-exported namespace, help!
  • Next by thread: Re: ObjC's flat and all-exported namespace, help!
  • Index(es):
    • Date
    • Thread