在项目中突然遇到一个问题,也就是_BSMachError: (os/kern) invalid capability (20) _BSMachError: (os/kern) invalid name (15)

  虽然该问题对界面展示以及数据保存都没有影响,但是处于本人对于提示错误的洁癖,对于该问题进行了调研.

  错误出现的情景:

- (void)showAlterView {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"是否确定放弃本次编辑" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action) {
}];

UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[self.navigationController popViewControllerAnimated:YES];
}];
[alertController addAction:cancelAction];
[alertController addAction:otherAction];
[self presentViewController:alertController animated:YES completion:nil];
}

点击确定后返回上一个控制器时会出现这个错误

  解决办法:

- (void)showAlterView {

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"是否确定放弃本次编辑" preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action) {

}];

UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

dispatch_async(dispatch_get_main_queue(), ^{

self.introduceTextView.delegate = nil;

[[NSNotificationCenter defaultCenter] removeObserver:self.introduceTextView];

[self.navigationController popViewControllerAnimated:YES];

});

}];

[alertController addAction:cancelAction];

[alertController addAction:otherAction];

[self presentViewController:alertController animated:YES completion:nil];

}

即将alterAction事件放到主线程中去执行.

ps:本人由于精力和时间有限,并没有对该问题进行深入研究,希望同行大神有什么理解还有深入研究,可以告知小女,小女在此谢过各位大牛.

_BSMachError: (os/kern) invalid capability (20) _BSMachError: (os/kern) invalid name (15) 问题的解决的更多相关文章

  1. iOS _BSMachError: (os/kern) invalid capability (20)

    _BSMachError: (os/kern) invalid capability (20) 解决办法:将info.plist里面的en改为United States 2016-04-18 22:4 ...

  2. Python os.path.dirname(__file__) 与 Python os.path.abspath(__file__) 与 os.system() 函数

    Python  os.path.dirname(__file__) 与 Python os.path.abspath(__file__) 的区别 os.path.abspath(__file__)返回 ...

  3. os引导程序boot从扇区拷贝os加载程序loader文件到内存(boot copy kernel to mem in the same method)

    [0]README 0.1) 本代码旨在演示 在boot 代码中,如何 通过 loader文件所在根目录条目 找出该文件的 在 软盘所有全局扇区号(簇号),并执行内存中的 loader 代码: 0.2 ...

  4. python获取某路径下,某种特定类型的文件名称,os.walk(路径)生成器;os.listdir(路径),os.path.splitext(名称),os.path.join(路径,名称),os.path.isdir(路径\名称)

    #获取某文件夹下制定类型文件# import os# def filep(fp):# l=[]# a=os.walk(fp) #生成器# for nowp,sonp,oth in a: #当前目录,子 ...

  5. nuxt/eapress 安装报错Module build failed: ValidationError: PostCSS Loader Invalid OptionsModule build failed: ValidationError: PostCSS Loader Invalid Options options['useConfigFile'] is an invalid additi

    错误信息: Module build failed: ValidationError: PostCSS Loader Invalid Options options['useConfigFile'] ...

  6. x01.os.12: 在 windows 中写 OS

    在 windows 中写操作系统,需要一系列的辅助工具.在此,要感谢川谷秀实!所有工具,都在 z_tools 文件夹中.有了大师的帮助,不妨也来尝试在 windows 中写一把 OS. 源代码及工具可 ...

  7. 关于在Mac OS下安装npm与cnpm的ERR! Darwin 15.0.0解决办法

    mac os安装好了很久了,不过没怎么用,昨天想要体验一下大神们推荐的黑苹果系统用起来怎么样(关于安装黑苹果的可以到我的简书去看相关文章),于是乎,打开久违的vmware,看着咬一口的苹果进度图,心中 ...

  8. Windows下虚拟机安装Mac OS X —– VMware Workstation12安装Mac OS X 10.11

    1下载  镜像:Instal OS X Yosemite 10.10.3(14D131).cdr        密码:qhhm 2 unlocker208文件(链接:https://pan.baidu ...

  9. Mac OS安装octave出现的问题-'error:terminal type set to 'unknown'的解决'

    学习Machine learning需要使用Octave语言,毕竟Andrew Ng (恩达.吴)力荐.本机系统Mac OS X EI Capitan, 其实什么系统都无所谓了,安装原理都是一样的. ...

随机推荐

  1. ES6-变量的解构赋值复习+学习

    ES6------变量的解构赋值 由于之前学过ES6的解构赋值,但是只是略看了一点网上的视频,所以今天就看了看ES6对这一部分的详细介绍,然后做一个总结的笔记. 首先,先大概说一下什么是变量的解构赋值 ...

  2. 为何我中断执行的线程不起作用,Why

    摘要:我们就以一个案例的形式,来为大家详细介绍下为何中断执行的线程不起作用. 本文分享自华为云社区<明明中断了线程,却为何不起作用呢?>,作者:冰 河. 当我们在调用Java对象的wait ...

  3. Java测试开发--Comparable和Comparator接口(五)

    Comparable 简介Comparable 是排序接口.若一个类实现了Comparable接口,就意味着"该类支持排序".此外,"实现Comparable接口的类的对 ...

  4. elasticsearch中query_string的隐藏坑

    elasticsearch查询中使用filter查询添加query_string格式为: {                    "query_string": {       ...

  5. Swift-Framework Error(一)桥接文件

    摘要 Xcode 编译工程代码时,出现编译错误时除了红色图标外,还会附送几句英文文本. 常规操作拷贝英文文本,放到搜索框中找答案,但是读懂这几句话能事半功倍. 项目中如果有 OC 和 Swift 两种 ...

  6. Effective C++ 总结笔记(六)

    七.模板与泛型编程 41.了解隐式接口和编译器多态 1.类和模板都支持接口和多态. 2.类的接口是显式定义的--函数签名.多态是通过虚函数在运行期体现的. 3.模板的接口是隐式的(由模板函数的实现代码 ...

  7. [atARC063F]Snuke's Coloring 2

    首先,可以通过将所有$x_{i}=0$都选择第1类,其余选第2类,构造出一个以$(0,0)$和$(1,h)$为左下角和右上角的矩形,答案即为$2h+2$,类似地还可以构造出$2w+2$ 若最终的矩形不 ...

  8. [loj3329]有根树

    题目即求$\min_{C}\max(|C|,\min_{x\notin C}w_{x})$,考虑将$w$从大到小排序,即为$\min_{1\le k\le n}\max(k,w_{k+1})$ 考虑若 ...

  9. react之react Hooks

    函数组件,没有 class 组件中的 componentDidMount.componentDidUpdate 等生命周期方法,也没有 State,但这些可以通过 React Hook 实现. Rea ...

  10. 【Sass/SCSS】我花4小时整理了的Sass的函数

    [Sass/SCSS]我花4小时整理了的Sass的函数 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢! 说明 Sass 定义了各 ...