在.mm文件中设置一个枚举变量时,XCode 报了下面错误:
Cannot initialize a parameter of type 'IPCameraNightMode' with an rvalue of type ''int"
上starckoverflow看了一下,原来是在引用枚举值的时候前面需要做一个类型强行转换。
[self setNModeBtns:nightModeInter_old];-》
[self setNModeBtns:(IPCameraNightMode)nightModeInter_old];
http://stackoverflow.com/questions/8502555/cannot-initialize-a-parameter-of-type-uiremote-notificationtype-with-an-rvalue-o点击打开链接
本文介绍了解决XCode中枚举变量初始化时出现的错误,并提供了正确的类型转换方法。
1855





