且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从MDM安装后,企业应用程序崩溃

更新时间:2023-02-03 10:12:52

这行对我来说太可怕了:

This line looks super scary to me:

  while ( self.parseData == NULL );

这可能是调试版本与发行版本之间的问题.我可以想象一个发布版本可以优化self.parseData的读取,而不必继续检查其他线程是否已对其进行更新.

It might be a debug vs. release build issue. I could imagine a release version optimizing the read of self.parseData to not keep checking if other threads have updated it.

我建议您以其他方式执行此操作-在这样的循环中轮询将CPU等待时将CPU固定为100%.我建议将其编写为与数据准备就绪时调用的完成块异步.

I recommend that you do this some other way -- polling in a loop like this pegs the CPU at 100% while it's waiting. I would suggest writing it to be asynchronous with completion blocks that you call when the data is ready.