0

How can make custom Exception Handling on objective C... Any useful tutorial please guide me...

Regards.

2 Answers 2

4

try/catch really should be avoided in all but the most extreme cases. Apple have a great API for handling situations where known errors will occur by usually including an NSError parameter in the message invocation or delegate callback. try/catch are not the usual mechanism for error handling but are used in extreme situations where you will usually abort your app anyway. I would encourage you to rethink your application design and use the standard means of error handling before resorting to try/catch.

Sign up to request clarification or add additional context in comments.

1 Comment

+1. I think it's particularly tempting for Java/C# developers to get started down the wrong path with this stuff.
0

In cocoa you may want to understand why Exception Happening and have to solve the situation more then Handling that..Any way you can use

@try
{ 
  //Your code
}

@catch(NSException* e) // or subclass of NSException
{

}

Refer this too

1 Comment

It's important to know that the semantics of the exception handling on ObjC is different to some other languages, such as C#, and great care must be taken to ensure that all objects are released properly. I suggest either using GC, or using autorelease pools extensively. (Or both!)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.