Reputation: 1819
This is simple question but I have search on Google and stackoverflow but I cant found an example.
I write enum in Account.h and define a method use this enum as parameter:
typedef NS_ENUM(NSUInteger, httpMethod){
GET = 0,
POST,
PUT,
DELETE
};
//method definition
-(void) location:(httpMethod)httpMethod withLocation:(NSString *)location;
In other class implementation, I call this method
// I do not know how to pass the enum as parameter
[self.myAccount location:Account.httpMethod.PUT withLocation:string];
Upvotes: 1
Views: 1445
Reputation: 3870
You can simply use the enum value:
[self.myAccount location:PUT withLocation:string];
Upvotes: 2