-2

Possible Duplicates:
What are the best practices for exceptions/returning NO/nil in Objective-c?
iphone: try end try

Is it good habit to write try and catch in iPhone application.

Or we can also handle error using coding and if else condition.
Please reply me as soon as possible.
Thanks.

Community
  • 1
  • 1
Mobile App Dev
  • 1,824
  • 3
  • 20
  • 45

1 Answers1

-1

Its always a good programming practice that you use exception handling to handle exceptions properly, otherwise your code will be crashed without showing user the reason for crash. By using @try, @catch you can handle exception properly.

  • 2
    This is not correct for Cocoa development in general. Exceptions here are unrecoverable errors, and generally should not be something you should try handling: http://stackoverflow.com/questions/3378696/iphone-try-end-try/3379240#3379240 – Brad Larson Jul 25 '11 at 20:57