Implicit @try/@catch?
Implicit @try/@catch?
- Subject: Implicit @try/@catch?
- From: Jim Kang <email@hidden>
- Date: Tue, 10 Nov 2009 23:44:17 -0500
I ran some code that apparently threw an exception of sorts, but it was
"caught" without any code explicit @catch block. It was like this:
SEL addSelfToPhysicalWorldSelector =
@selector(addSelfToPhysicalWorld:atPosition:);
if ([self respondsToSelector:addSelfToPhysicalWorldSelector])
{
NSMethodSignature *addSelftoWorldSig =
[self
methodSignatureForSelector:addSelfToPhysicalWorldSelector]; // SKIPS RIGHT
HERE.
...<other code in if clause>
}
...<code outside of if block> // THIS IS TO WHERE IT SKIPS.
When I stepped through it, a sort of exception was thrown at the call to
methodSignatureForSelector (it didn't like that the selector had an argument
that was a raw pointer instead of an id or pointer to an Objective-C
object). Execution then jumped outside of the if block, skipping over the
rest of the code in the if block. There's no @try @catch in this method this
code is in.
Any explanations for the jump?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden