gpt4 book ai didi

objective-c - shouldAutorotateToInterfaceOrientation 在启动时被调用两次

转载 作者:可可西里 更新时间:2023-11-01 04:53:50 26 4
gpt4 key购买 nike

我正在从事 iOS 5 目标项目。我的定位方法如下。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
NSLog(@" My Orientation");

return YES;
}

但是,当我的应用程序启动时,我的日志消息将在控制台上显示两次,即我的 Orientation 将显示两次。我正在模拟器中测试我的应用程序,这只是在启动时发生,甚至没有改变 orientation 然后甚至在改变方向时再次发生。即,

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

每次都被调用两次,我认为这不是正确的行为。任何帮助都是

表示赞赏。

最佳答案

这不是你做过的事。 Apple 已多次让设备对此作出 react 。这仅取决于应用程序在做什么。可能是 View 加载或其他原因导致它再次触发。然而,这真的是个问题吗?在大多数情况下,它不是(或者至少不应该是)。

如果这真的是一个问题,那么也许有人应该详细说明。但是,至少根据我的经验,这是常见的行为。我不知道有什么方法可以解决这个问题。

我想如果这真的困扰您并且没有办法解决,您可以向 Apple 提交错误。

关于objective-c - shouldAutorotateToInterfaceOrientation 在启动时被调用两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13950509/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com