Re: try/catch/throw/finally example?
Re: try/catch/throw/finally example?
- Subject: Re: try/catch/throw/finally example?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 26 Aug 2006 09:02:19 +0200
On 26 Aug 2006, at 04:31, Todd Yandell <email@hidden> wrote:
On Aug 25, 2006, at 12:38 PM, Roland Silver wrote:
Can someone suggest a tutorial or example of the use of @try,
@catch, @throw, @finally, in Objective-C, other than the Apple
document "Exception Handling and Thread Synchronization"?
NSString *stringOne = @"One";
NSString *stringTwo = @"Two";
@try {
[stringOne appendString:stringTwo];
} @catch (id theException) {
NSLog(@"%@ doesn't respond to appendString:!", [stringOne class]);
} @finally {
NSLog(@"This always happens.");
}
How is this different from:
@try {
[stringOne appendString:stringTwo];
} @catch (id theException) {
NSLog(@"%@ doesn't respond to appendString:!", [stringOne class]);
}
NSLog(@"This always happens.");
that is: what is the @finally clause good for, as the next statement
after the @try block also gets executed in all cases?
Or what am I missing?
Geriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden