views:

241

answers:

1

Altough I already know it's not possible, as my understanding how programming works, I would like to have a confirmation of this.

I have an enum

typedef enum {
enum_first=1,
enum_second=2
} myenum

I wanted to do overloading of method, this syntax is obviously wrong, but it gives the idea:

-(id)myenumTest:(myenum.enum_first)value {...}

-(id)myenumTest:(myenum.enum_second)value {...}

Can you suggest an alternative way for this ?

thanks Leonardo

+3  A: 

I'd use a case statement within the method based on the value of the enum variable.

Frank V