Excuse me for repeating my question. I have looked carefully in my
WebObjects Info Center, and asked some colleges, but I'm still stuck on
this:
I have obviously not figured out how to catch an NSRangeException. The
following try-catch doesn't seem to work:
public EOEnterpriseObject trInfoV () {
EOFetchSpecification trSpec =
new EOFetchSpecification("TRInfo", null, null);
NSArray trArr =
this.defaultEditingContext().objectsWithFetchSpecification(trSpec);
try {
return (EOEnterpriseObject)trArr.objectAtIndex(0); // row 1
}
catch (Exception e) { // NSRangeException
System.out.println("*** catch NSRangeException: " + e.getMessage());
}
return null; // ???
}
In my first attempt, I tried "catch (NSRangeException e) {...", but I
couldn't figure out the right com.apple.yellow thing to import (if any). I
have also tried "catch (NSException e)", but I got no reaction there
either. Other kinds of Exceptions (e.g. NullPointerException) work like a
dream. NSRangeException seems to be ... exceptional ;)
Any hints?
/Jon
---------------------------------------------------------------------------
Jon Kleiser / ADB-seksjonen / USIT / University of Oslo / Norway
Mail: [EMAIL PROTECTED] / Tel: +47-22 85 28 04 / Fax: +47-22 85 29 70
---------------------------------------------------------------------------