zoukankan      html  css  js  c++  java
  • _BSMachError: (os/kern) invalid capability (20) _BSMachError: (os/kern) invalid name (15) 问题的解决

      在项目中突然遇到一个问题,也就是_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:本人由于精力和时间有限,并没有对该问题进行深入研究,希望同行大神有什么理解还有深入研究,可以告知小女,小女在此谢过各位大牛.

  • 相关阅读:
    【Oracle】实体化视图
    安装Linux Centos系统硬盘分区方法
    .NET基础一
    【MySQL】无法启动mysql服务(位于本地计算机上)错误1067,进程意外中止
    Linux基础一
    SQL Server中生成100万行8位纯数字的随机数(转)
    SQL Server配置数据库邮件
    SQL点点滴滴_聪明的小写法(持续更新中)
    过去的2017和已经到来的2018
    【Oracle】PL/SQL Developer使用技巧(持续更新中)
  • 原文地址:https://www.cnblogs.com/HMJ-29/p/5647363.html
Copyright © 2011-2022 走看看