最近遇到的两个问题,是在iOS真机调试的时候遇到的
翻遍了stackoverflow和百度google。仍然没找到解决方案!!!!先挖个坑,找到答案再填上。。
error1:调用相机出现的bug
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
2,还有其他的方法,比如延时调用:
You should initialize your Camera in your UIViewController
, only after the view has Loaded and with a timeout:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
//show camera...
if (!hasLoadedCamera)
[self performSelector:@selector(showcamera) withObject:nil afterDelay:0.3];
}
3,把 imagePicker 存成全局变量……
最后!!!查了半天。。有些程序猿负责任地告诉我, 这只是个 warning,不影响正常使用,某大公司的 app 也会报这个 warning。直接忽略掉它就可以…………………………
我用了大半天查的问题!!!忽略即可TVT
直接忽略就是了,没有任何影响,貌似是IOS 8的一个bug
erro2:
error in __connection_block_invoke_2: Connection interrupted
只找到了以下: 不过也没看懂= =
iOS9锁屏控制台会打印警告
加入运行如下示例代码:
1
2
3
4
5
6
7
8
9
10
|
- (void)viewDidLoad {
[
super
viewDidLoad];
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^(void) {
//在这个10秒内锁屏
NSLog(@
"准备休眠"
);
sleep(10);
NSLog(@
"打印成功"
);
});
}
|
应用运行过程中锁屏,总是会出现以下提示:
1
2
3
4
5
6
|
** -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action ->{
handler = remote;
info ={
(1) = 5;
};
}
|
当应用处于空闲状态时(无网络请求)锁屏对于用户而言并无较大影响,但是当应用在执行某个异步任务时(比如下拉刷新一下列表)锁屏,重新解锁进入就可能会发现异步任务失败,控制台也会提示 Error 信息:
1
2
3
4
5
6
7
|
** -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action ->{
handler = remote;
info ={
(1) = 5;
};
}
error
in
__connection_block_invoke_2: Connection interrupted
|