I hope the title is precise enough.
I was wondering, how I can pass a interface implementation to an object in objc language.

In java it would look like:

```
public interface MyInterface {
    void onData();
}

```

The implementing class 

```
public class ImplementMyInterface {

    // ...
    // other methods
    ///

    void registerInterface(){
         MyInterface myInterface = new MyInterface(){
             @Override
             public void onData(){
               // process data here within the class
             }
           }; 
     }
}

```

And in objc?
id myinterface.

How to implement it in the class?
Is there only the possibility to let the class inherit the interface?
Like 

```
interface MyInterface : NSObject

```

and the implementing class

```
MyImplementingClass : MyInterface

```

Or is there another possibility?
Thank you in advance