热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Xcode6.1:快照未呈现的视图

如何解决《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];
}

此代码位于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");
}

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

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

这条消息与什么有关?


推荐阅读
author-avatar
laoshu仔
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有