UIDevice.currentDevice().performSelector( "setOrientation:", withObject:UIInterfaceOrientation.LandscapeRight )
有如上代码 后面 withObject 的参数是一个 AnyObject 类型的,这样直接传的话会报错,试过几种方法都不行,求大神帮忙。T T
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
Repost UIInterfaceOrientation.LandscapeRight.rawValue
UIInterfaceOrientation.LandscapeRight.rawValue
id corresponds to AnyObject?, you define a var with ? and try it:
import Foundation func displayObjectName(yourobject : AnyObject?) { NSLog("%@",yourobject as! String); } var s:String?="Hello,World"; displayObjectName(s);
Repost
UIInterfaceOrientation.LandscapeRight.rawValue
id corresponds to AnyObject?, you define a var with ? and try it: