?
Solved

try-catch - c language

Posted on 2013-12-09
4
Medium Priority
?
467 Views
Last Modified: 2013-12-26
Hi,

Is there try catch feature in objective c? I am doing some code and it is very difficult to get exact reason of error. Like in try -catch, we can get exact error in catch.

Please let me know if there is try-catch and how to implement it? If it is not then how can I catch exact error?

Thanks
0
Comment
Question by:Johny12345
4 Comments
 
LVL 26

Assisted Solution

by:tigin44
tigin44 earned 664 total points
ID: 39708005
you can find an example of try catch usage in objective c


http://stackoverflow.com/questions/3363612/try-catch-block-in-objective-c
0
 
LVL 35

Accepted Solution

by:
sarabande earned 668 total points
ID: 39709289
note, you would not get an exception in case of a segmentation fault, means on pointer errors.  you could write  a signal handler which handles those errors and turns them to a NSException. but as far as I know that would not prevent your program from hanging because the code (normally) could not recover from such kind of errors.  

Sara
0
 
LVL 12

Assisted Solution

by:stefan73
stefan73 earned 668 total points
ID: 39715407
@Sara: depends - at least the code could print a stack trace in such a case, or at least try to do so. If the logging modulel itself is affected, this won't work.
0
 

Author Closing Comment

by:Johny12345
ID: 39741105
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question