当前位置: 代码迷 >> Iphone >> @@Cast of 'int' to 'id' is disallowed with ARC,请大侠指点@@,该怎么解决
  详细解决方案

@@Cast of 'int' to 'id' is disallowed with ARC,请大侠指点@@,该怎么解决

热度:316   发布时间:2016-04-25 06:42:45.0
@@Cast of 'int' to 'id' is disallowed with ARC,请大侠指点@@
各位大侠好,请教一个问题:
我需要在代码中强制性地旋转到一个特定方向
ios5以后不能直接使用setOrientation方法了,找了网上的贴子说可以通过下面的代码实现
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
  [[UIDevice currentDevice] performSelector:@selector(setOrientation:)
  withObject:(id)UIInterfaceOrientationLandscapeRight];
  }
由于使用了ARC,系统会提示
Cast of 'int' to 'id' is disallowed with ARC
尝试了一些修饰词都还是不行,请大侠指点


------解决方案--------------------
buildseting --搜auto 然后把object-c++ auto...设置no
------解决方案--------------------
你看看这是哪个文件,可以设置某个文件不适用ARC的。
在target中的compile sources中,将该文件指定成-fno-objc-arc
就可以了
  相关解决方案