Bug that only appears in archived Mac OS X product

寵の児 提交于 2019-12-10 10:25:18

问题


My friend and I are developing an app for the Mac app store. We submitted it to the app store but Apple rejected it on the basis of a bug we'd never experienced before ourselves. We had a hard time reproducing the error, but after quite some time debugging we found out that the bug only appears in an archived product.

The symptom of the bug is that some of the buttons in our app suddenly stop responding after using the app for a random amount of time. The only time we see this problem is in an archived app, so trying to find out what causes the problem is difficult.

What is actually happening when we archive our app? How does it differ from a build running directly in Xcode? Have anyone of you experienced a similar problem?


回答1:


What you have found is a heisenbug.

When you build your code for debugging, the compiler does not optimize your final build product. When you archive your application, the compiler will optimize the final product to make it run faster and take less memory. Your bug only shows up when you have optimized code.

You could be experiencing a deadlock or some other race condition that isn't present in the debug version of your application. You could build and run against your release configuration of your target and see if you can identify where it might be occurring.

Without seeing the code, however, SO won't be much help to you. Good Luck!



来源:https://stackoverflow.com/questions/9337511/bug-that-only-appears-in-archived-mac-os-x-product

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!