我想通过typedef NS_ENUM
让我的代码更具可读性。我有3个案例。请查看代码:
typedef NS_ENUM(NSInteger, drawCase) {
drawCaseStart,
drawCaseIn,
drawCaseAfter
};
@interface DayGraphViewCircle ()
@property (nonatomic) drawCase *myCase;
然后:
-(void)choseDrawCase{
switch (self.drawCases) {
case 0:
_myCase = drawCaseStart;
break;
case 1:
_myCase = drawCaseInProcess;
break;
case 2:
_myCase = drawCaseAfter;
break;
default:
break;
}
}
如果1和2编译器使用黄色不兼容integer to pointer conversion assigning to 'drawCase *' (aka 'enum drawCase *') from 'NSInteger' (aka 'long')
我做错了什么?