Possible Duplicate:
Creating an abstract class in Objective C
I’d like to make abstract class in Objective-C project.
But, I can’t find ideas suchlike ‘abstract'(in java), ‘virtual'(in c++).
Doesn’t Objective-C have an abstract idea? Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Formally, no. Abstract classes are implemented by stubbing out methods in the base class and then documenting that a subclass must implement those methods. The onus is on the author to write classes that match the class contract rather than on the compiler to check for missing methods.
Objective-C has protocols, which are like Java interfaces. If you’re looking for the equivalent to a pure virtual C++ class or an interface in Java, this is what you want.