Working with the Objective-C/Cocoa flat namespace

Posted by Stephen Blinkhorn on Stack Overflow See other posts from Stack Overflow or by Stephen Blinkhorn
Published on 2010-05-05T17:02:31Z Indexed on 2010/05/05 23:38 UTC
Read the original article Hit count: 261

Filed under:
|
|

I've not found anything that addresses my specific name space question as yet.

I am working on some AudioUnit plug-ins featuring Cocoa based GUIs. The plug-ins use a common library of user interface classes (sliders, buttons etc) which are simply added to each Xcode project.

When I recompile and distribute updates it is pretty much guaranteed that at least one user interface class will have been updated since the last release. If the user launches an older plug-in before an updated plug-in then the old Cocoa classes are already loaded into the run time and the plug-in attempts to use the older implementations - often resulting in a failure one way or another.

I know frameworks are the intended solution but the overhead and backwards compatibility issues are not ideal. I prefix all class names where possible but what options do I have to ensure that each plug-in contains unique class names for the shared user interface classes?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c