Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

try-catch - c language

Posted on 2013-12-09
4
415 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 166 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 33

Accepted Solution

by:
sarabande earned 167 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 167 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

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