I have created three classes, and one method in one of the classes, but I only want my other two classes to be able to call the method. Any guess how to do this.
Thanks.
I have created three classes, and one method in one of the classes, but I only want my other two classes to be able to call the method. Any guess how to do this.
Thanks.
As mentioned in links given in the comments, a Category will get you similar behaviour in Objective-C. The difference, compared to C++, is that it's voluntary rather than enforced by the compiler.
Any class that imports the Category header can make the call and, even if the header isn't published, a programmer can call the method if the signature is known by declaring a Category interface (or ignoring a compiler warning).
If you're doing this as a way of reminding yourself not to call those methods, Categories work well. If you were trying to protect against someone else "hacking into" the methods, it would be little defense.