我在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]
我找不到有关此方法及其行为的任何描述,任何想法,我可以找到有关此内部方法的更多信息?
重现这个的简单步骤:
更新您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)我将lcov与 Objective-C 项目和XcodeCoverage脚本结合使用,并获得了一份关于代码覆盖率的漂亮 html 报告。
不过,我想“保留”中间.gcov文件(如果有)以将它们提供给另一个工具。类似的--keep选项gcovr。lcov提供这样的选择吗?它是否生成任何中间.gcov文件?
我确信我在文档中遗漏了一些明显的东西。谢谢。