【iOS 】把一些不太重要的任务放在空时执行
2015-04-06 15:22 l4y 阅读(209) 评论(0) 编辑 收藏 举报-(void)idleNotificationMethod { } -(void)registerForIdleNotification { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(idleNotificationMethod) name:@"IdleNotification" object:nil]; NSNotification *notification = [NSNotification notificationWithName:@"IdleNotification" object:nil]; [[NSNotificationQueue defaultQueue] enqueueNotification:notification postingStyle:NSPostWhenIdle]; }
本文来自博客园,作者:l4y,转载请注明原文链接:https://www.cnblogs.com/xjshi/p/4396015.html