美文网首页iOS在路上
machOView运行报错‘string can't find’

machOView运行报错‘string can't find’

作者: 黑炭长 | 来源:发表于2020-10-28 17:45 被阅读0次

    string can't find

    1、缺少c++文件 地址 按照说明操作
    2、target --> build Phases --> Link Binary 添加libc++.tbd
    3、target --> build setting 按图示设置

    截屏2020-10-28 17.34.49.png

    macOS no find

    target --> build setting --> base SDK 设置为支持的版本

    打开文件奔溃问题

    1、DataController.mm 164 line方法做如下修改

    - (void)writeString:(NSString *)str toFile:(FILE *)pFile
    {
        if (str) {
            fwrite(CSTRING(str), [str length] + 1, 1, pFile);
        }
      
    }
    

    2、document.mm 449 line(handleThreadStateChanged)方法作如下修改

    - (void)handleThreadStateChanged:(NSNotification *)notification
    {
      if ([notification object] == dataController)
      {
        NSString * threadState = [[notification userInfo] objectForKey:MVStatusUserInfoKey];
        if ([threadState isEqualToString:MVStatusTaskStarted] == YES)
        {
          if (OSAtomicIncrement32(&threadCount) == 1)
          {
              dispatch_async(dispatch_get_main_queue(), ^{
                [progressIndicator setUsesThreadedAnimation:YES];
                [progressIndicator startAnimation:nil];
                [stopButton setHidden:NO];
              });
          }
        }
        else if ([threadState isEqualToString:MVStatusTaskTerminated] == YES)
        {
          if (OSAtomicDecrement32(&threadCount) == 0)
          {
            dispatch_async(dispatch_get_main_queue(), ^{
                [progressIndicator stopAnimation:nil];
                [statusText setStringValue:@""];
                [stopButton setHidden:YES];
            });
          }
        }
      }
    }
    

    最后运行成功,将运行得到的MachOView.app 拖至 applications 即可使用

    相关文章

      网友评论

        本文标题:machOView运行报错‘string can't find’

        本文链接:https://www.haomeiwen.com/subject/fyrcvktx.html