Exception handling: confused by syntax
Exception handling: confused by syntax
- Subject: Exception handling: confused by syntax
- From: Mario Diana <email@hidden>
- Date: Fri, 13 Sep 2002 09:25:31 -0400
Hello,
I'm confused by how to handle exceptions. The two Cocoa books I own are
of no help, and what I've come across on the archives is not complete
enough for me to make sense of.
My code could throw an NSInvalidArgumentException under some conditions.
I know how I will handle the exception, I just don't know how to code
catching it.
If it were Java, I'd do this:
public void myMethod() {
try {
// do the thing...
}
catch (NSInvalidArgumentException iae) {
// handle the error...
}
}
Okay, I see the NS_DURING, etc., but I'm just lost -- really! Would
somebody please be kind enough to recode the above method for Cocoa in
Objective-C? And, I'm a bit embarrassed to ask this, but code
everything: especially, the variables I have to declare at the top of
the block (if any).
This one little thing is driving me crazy.
Many thanks,
Mario Diana
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.