Hi, I'm very new to Objective-C and the Cocoa framework. I'm primarily a C# .NET Devleoper, and I have a problem with enums in Objective-C hopefully one of you can answer.
When I build this I get a build error "Expected expression before 'SomeEnum'" on all 3 of the cases. This is valid in C# and Java, I wondered what I am doing wrong in Objective-C?
Thanks
Code:
#import <Foundation/Foundation.h>
enum SomeEnum{
None = 0,
OptionOne = 1,
OptionTwo = 2
};
typedef int SomeEnum;
@interface untitled : NSObject {
}
-(void) doSomethingBasedOn: (int) id;
@end
@implementation untitled
-(void) doSomethingBasedOn: (int) id{
switch(id)
{
case SomeEnum.None:
break;
case SomeEnum.OptionOne:
break;
case SomeEnum.OptionTwo:
break;
}
}
@end
When I build this I get a build error "Expected expression before 'SomeEnum'" on all 3 of the cases. This is valid in C# and Java, I wondered what I am doing wrong in Objective-C?
Thanks
Last edited: