Project-profile
Reproduced from: http://blog.csdn.net/zzh_gaoxingjiuhao/article/details/7830864
Secret:
1. If the crash is inside the MAIN.M, you can set the global exception breakpoint (Exception breakpoint).
2. You are not getting useful information in the state where the exception breakpoint is turned on. In this case, run the app a few more times, or enter the "PO $eax" command after the debugging prompts.
3. The general cause of most crashes and some bugs are missing or wrong connections in your xib or storyboard. These situations do not appear in the compilation error, so you generally do not know.
4. Do not ignore compilation warnings. If you have a compile warning, you may have something wrong. If you don't know why you're going to a compile warning, it's best to figure it out. These are safe practices!
5. Debugging on the device may be slightly different from the one on the simulator. These two environments are not exactly the same, and you will get different results.
For example, when you run a problematic program on iphone4, the first crash occurs when Nsarray initializes, because you lack a nil tag, not because it crashes when the app executes setlist:. So the above principle approach will help you find the root of the crash problem.
Don't forget the static analyzer tool, which will catch more bugs. If you are a beginner, you are recommended to open it. You can set up your project on the Build Settings screen: