前些天在做app升级提示的时候,遇到了警告:
_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)
原因:是自己在alertAction中添加了时间,但是并未采用延时机制。
解决办法:
[alertVC addAction:[UIAlertAction actionWithTitle:@"现在升级" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//这里添加了多线程,消除警告
dispatch_after(0.2, dispatch_get_main_queue(), ^{
NSURL *appStoreUrl = [NSURL URLWithString:[NSString stringWithFormat:kAppStore_APPVersionUrl,APP_ID]];
[[UIApplication sharedApplication] openURL:appStoreUrl];
NSLog(@"链接--%@",appStoreUrl);
});
}]];
另一种解决方案:
http://stackoverflow.com/questions/32341851/bsmacherror-xcode-7-beta