On 19 Apr 2009, at 23:22, Aroon Pahwa wrote:

My first soltion was to prepend the name of the containing class to the name of the nested class so in the previous example I would end up with SomeContainerClass_ResultInfo and SomeOtherContainerClass_ResultInfo. My issue with this is that the names are waaaay too long.

Don't forget that you can use the preprocessor. For instance you might do something like

  #define P(x)          CURRENTCLASS ## x
  #define CURRENTCLASS  SomeContainerClass

  ...

then the "nested" classes' names can be written

  P(ResultInfo)

and when you want to define the other class simply

  #undef CURRENTCLASS
  #define CURRENTCLASS  SomeOtherContainerClass

I'm wondering if anyone has had to deal with this issue before and has any ideas of what I can do to keep the names short, not kill the usefulness of Code Sense in XCode, and come at least close to gauranteeing no naming collisions between these translated nested classes.

Not sure my solution really fulfils all of the above, but it's certainly shorter.

I will just add that it's possible that the problem you're having here is being caused by your having too many similar classes; maybe some of your custom classes could be replaced by e.g. NSDictionary instead?

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to