Bug that only appears in archived Mac OS X product

2019-05-17 09:01发布

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条回答
你好瞎i
2楼-- · 2019-05-17 09:40

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!

查看更多
登录 后发表回答