Private Methods in Objective-C

Posted by connatser on Aug 6, 2011 in Development | No Comments

One of the first things I looked for when starting to learn Objective-C was how to implement “private” methods in a certain class. I say “private” because there is no real way to implement a private method in Objective-C, however this is a good way to at least hide a method. My team mates pointed out a simple way to do this, by adding an @interface declaration just above the @implementation declaration. You then list any method that you want remain private to that class.

More detailed information on the topic can be found on StackOverflow.

For example:

Switch to our mobile site