I'm trying to start working on iOS development with Objective-c. I have a lot of experience with Java, so I try to do things in a Java way. Please help me to understand the correct way to code in Objective C.
I have the following interface in Java:
public interface MyInterface {
void onSuccess(String successString);
void onError(String errorMessage);
}
I will use it like this:
public static void main(String... args){
MyInterface interface = new MyInterface() {
@Override
public void onSuccess(String successMessage) {
// things happen here
}
@Override
public void onError(String errorMessage) {
}
};
}
How do I convert this code to Objective C? I need to create an interface and pass an instance of this interface to another C method.
I've tried blocks(^), but it is acceptable only when I need to pass an object with only one callback. What is my approach to pass an object with two callback functions to a method?