views:

45

answers:

2

I have this in java:

public interface SomeInterface {
    public void doSomething();
}

public class ParentClass {
}

public class ChildClass extends ParentClass implements SomeInterface {
    public void doSomething() { }
}

Is this possible on objective c? How to do it on objective-c?

+1  A: 

As long you have this method public void doSomething() defined in ChildClass it is fine.

fastcodejava
but how to do in objective-c?
okami
+2  A: 

It sounds like you're just asking "How do I declare that a class conforms to a protocol?" If that's what you're asking, Cocoa is full of examples. Here's the declaration of NSString:

@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>

You would probably benefit from reading Apple's overview, The Objective-C Programming Language. It's short and covers pretty much everything you need to know about the Objective-C language itself.

Chuck