THROWING AN EXCEPTION IN OBJECTIVE-C

Felix Pickles

Total Post:24

Points:168
Posted by  Felix Pickles
 683  View(s)
Ratings:
Rate this:

I was learning Objective-C and trying to create apps, but some times I am getting exceptions in my code.

Can anyone tell me the best way to handle exceptions in iOS.

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Throwing an Exception in Objective-C

    I will prefer NSException class to handle exceptions in our program,
    I use [NSException raise:format:] as follows:

    [NSException raise:@"Invalid value" format:@"Code %d is invalid", str];

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!