views:

165

answers:

4

Is there any tips to avoid crashing of iPhone applications. Sometime it is very difficult to understand where the problem is. What are the possible reasons of iPhone app crashes ?

+2  A: 

Crashes are caused by bugs in your code. To prevent these you need to:

(a) learn how to write robust code
(b) learn how to test your code (with particular attention to stress testing)
(c) learn how to debug
Paul R
+3  A: 

One of the biggest causes of crashes on the iPhone platform is not following the Cocoa Memory Management rules.

See this question: http://stackoverflow.com/questions/106627/memory-management-in-objective-c

Gordon Christie
+1  A: 

This is not specific to the iPhone-platform, but what helps a lot is catching (proper) exceptions and logging the exceptions-messages somewhere so you know what went wrong and don't only get a "force close"-message with little or nor further information.

Select0r
+1  A: 

you should add NSZombie class to your project to avoid EXC_BAD_ACCESS errors... even this helps to understand what's happened. So to do it you should click on the Get Info of your Executables and then go to the Arguments and there you can add NSZombieEnabled with value YES and MallocStackLoggingNoCompact =1

Kirill SIMAGIN