首页 > iOS ARC下,把 NSInteger 转化为 id

iOS ARC下,把 NSInteger 转化为 id

在iOS MRC下,把NSInteger转化为id,可以直接强转,(id)UIDeviceOrientationLandscapeLeft,然后就可以performselector withobject,
现在我在ARC下同样的代码就会报disallowed的错误,那要怎么转化呢?前提我不想用mrc,那些关掉ARC的方式就算了,也不想用NSInvocation,麻烦,求助!


NSInteger a = 1;
id b = @(a);
b为NSNumber类型

友情提示:强制转换是有问题的

【热门文章】
【热门文章】