小编laz*_*i74的帖子

应该在iOS 8中进行动作

我在UIViewController shouldAutorotate方法上发现了7.1和8之间的小行为变化.Apple View Controller编程指南指出在执行任何自动旋转之前调用此方法.

但是我注意到,当我只是禁用shouldAutorotate(返回NO)时,该方法在Portrait - > Landscape rotation上调用,但不在下面的Landscape - > Portrait rotation上调用.同样应该始终按照我的理解调用该方法.在iOS 8上运行时会发生这种情况,但在iOS 7.1上则不会.

这似乎与iOS8中调用堆栈中的新方法有关:

[UIWindow shouldAutorotateToInterfaceOrientation:checkForDismissal:isRotationDisabled]

我找不到有关此方法及其行为的任何描述,任何想法,我可以找到有关此内部方法的更多信息

重现这个的简单步骤:

  1. 在Xcode中创建一个新的单视图应用程序项目
  2. 更新您ViewController.m的实施shouldAutorotate

    - (BOOL)shouldAutorotate
    {
        UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
        NSLog(@"%s orientation is %@", __PRETTY_FUNCTION__, [self stringFromDeviceOrientation:orientation]);
        // Disable autorotation of the interface.
        return NO;
    }
    
    - (NSString *) stringFromDeviceOrientation:(UIDeviceOrientation)uido
    {
        NSString *orientation = @"UIDeviceOrientationUnknown";
        switch (uido) {
            case UIDeviceOrientationPortrait:
                orientation = @"Portrait";
                break;
            case UIDeviceOrientationPortraitUpsideDown:
                orientation = …
    Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios

8
推荐指数
1
解决办法
1万
查看次数

lcov 是否生成中间 .gcov 文件?

我将lcov与 Objective-C 项目和XcodeCoverage脚本结合使用,并获得了一份关于代码覆盖率的漂亮 html 报告。

不过,我想“保留”中间.gcov文件(如果有)以将它们提供给另一个工具。类似的--keep选项gcovrlcov提供这样的选择吗?它是否生成任何中间.gcov文件?

我确信我在文档中遗漏了一些明显的东西。谢谢。

xcode objective-c clang gcov lcov

4
推荐指数
1
解决办法
657
查看次数

标签 统计

objective-c ×2

clang ×1

gcov ×1

ios ×1

iphone ×1

lcov ×1

xcode ×1