在myObject.h
:
typedef enum {
GET,
POST
} HTTPMethods;
然后在@interface
定义内部,一个属性:
@property (nonatomic) HTTPMethods *httpMethod;
在myClass.m
中,我有#import
ofmyObject.h
然后:
myObject *obj = [[myObject alloc] init];
obj.httpMethod = POST;
这似乎可行,但编译器对我大喊:
`Incompatible integer to pointer conversion assigning to 'HTTPMethods *' from 'int'.
我在哪里错了?