Xcode 6.1:快照未呈现的视图

Jay*_*bey 7 snapshot objective-c ios8 xcode6.1

我正在为我的示例项目使用storyboard.该体系结构是Login View Controller和Home PageView控制器.用户单击Home PageView控制器中的按钮以启动本地通知.

-(IBAction)startLocalNotification {  // Bind this method to UIButton action
    NSLog(@"startLocalNotification");

    UILocalNotification *notification = [[UILocalNotification alloc] init];
    notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:7];
    notification.alertBody = @"This is local notification!";
    notification.timeZone = [NSTimeZone defaultTimeZone];
    notification.soundName = UILocalNotificationDefaultSoundName;
    notification.applicationIconBadgeNumber = 10;

    [[UIApplication sharedApplication] scheduleLocalNotification:notification];
}
Run Code Online (Sandbox Code Playgroud)

此代码位于AppDelegate文件中:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]){

        [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:nil]];
    }

    [launchOptions valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
    // Override point for customization after application launch.

    return YES;
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
 [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
     NSLog(@"didReceiveLocalNotification");
}
Run Code Online (Sandbox Code Playgroud)

现在,在将app推送到后台状态后,我在控制台中收到消息,但本地通知正常工作正常.

快照未呈现的视图会导致空快照.确保在屏幕更新后快照或快照之前至少渲染了一次视图.

这条消息与什么有关?

but*_*ton 3

我有一个我认为可以作为“答案”的东西......那就是几乎可以肯定没有任何问题,但可能是 iOS(8.1.3/8.2)的问题。据我所知,它是无害的。

我研究了一下,发现它与 UITextField/Keyboard 有关。

因此,只有一个文本字段的单视图应用程序,请按照以下步骤操作(仅在 iPad 上尝试过):

  1. 构建并运行
  2. 将焦点放在文本字段中
  3. 关闭键盘(它应该已经打开)
  4. 单击主页按钮(应用程序进入后台)
  5. 返回应用程序
  6. 单击主页按钮(应用程序进入后台)
  7. 观察日志输出。

这是一个示例项目: https: //github.com/duttski/TestForStrangeSnapshotMessage

提交为错误并尝试通过开发论坛获取一些信息。

更新:我认为这可能会在以后的版本中得到修复。但我还没有测试过。在开发论坛上发言后,我被告知这不是值得担心的事情。