macrumors 68020

Note that unlike Java this doesn't actually prevent other objects accessing these methods. You'll get the normal warning about methods not existing when you compile, but it'll work at runtime.

Click to expand...

Yes, the problem is that the Obj-C runtime doesn't offer the protections during execution, as it doesn't know what is private and what isn't when it comes to methods.

But, for the sake of most development, the distinction of public/private isn't to actually protect code, but act as enforcement for good code policy, and help make it clear what can and shouldn't be used in APIs. Categories are sufficient for this purpose.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.