Any way to silence the UIDevice setOrientation warning?

笑着哭i 提交于 2020-01-04 08:05:11

问题


Anyone have a simple way to silence the undocumented UIDevice setOrientation warning?

I found this piece of code that silences the undocumented UIPickerView setSoundsEnabled warning.


回答1:


just declare the method in a category in the .h or .m file of wherever you use it:

@interface UIDevice (MyPrivateNameThatAppleWouldNeverUseGoesHere)
- (void) setOrientation:(UIInterfaceOrientation)orientation;
@end



回答2:


Why not just subscribe to the orientation notifications? They are supported and work at the same time.

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];



回答3:


Maybe you should try to add your controller to the window view directly. It's a bit boring but it works well ! http://www.geckogeek.fr/iphone-forcer-le-mode-landscape-ou-portrait-en-cours-dexecution.html :-)



来源:https://stackoverflow.com/questions/1682639/any-way-to-silence-the-uidevice-setorientation-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!