It's not possible to do this. ObjC will allow you to send any message to any other object. The best you can do is not publicly expose the method and that is exactly what the Cocoa framework does. To be honest, trying to use C++ just for this seems a waste of time; perhaps you should explain why you want to do this? Is it to try and partition your code up, is this something that really MUST stop, say, plugins from accessing the code?

Mike.

On 22 Feb 2008, at 11:00, Philip Bridson wrote:

How do I make a method private?

I have tried putting @private before the method that I want to make private but the compiler flags a parse error. I read the documentation and I can only find reference to private member variables. I want to make sure that a method can only be accessed via another method in the same class. Is this possible in Objective- C or do I need to write this class in C++?

Many thanks.

Phil.
_______________________________________________

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/cocoadev%40mikeabdullah.net

This email sent to [EMAIL PROTECTED]

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to