开发者

Any way to silence the UIDevice setOrientation warning?

开发者 https://www.devze.com 2022-12-10 11:18 出处:网络
Anyone have a simple way to silence the undocumented UIDevice setOrientation warning? I foun开发者_如何学JAVAd this piece of code that silences the undocumented UIPickerView setSoundsEnabled warning.

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

I foun开发者_如何学JAVAd this piece of code that silences the undocumented UIPickerView setSoundsEnabled warning.


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


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

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];


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 :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号