Hi,


Here is an odd problem i found.

 $self->{'textBoxen'}->setString($file);

if file is undefined, the app blows up real good.

2004-08-06 15:06:38.993 PerlButtonTest[3392] An uncaught exception was raised
2004-08-06 15:06:38.993 PerlButtonTest[3392] *** -[NSTextView replaceCharactersInRange:withString:]: nil NSString given.
2004-08-06 15:06:38.993 PerlButtonTest[3392] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSTextView replaceCharactersInRange:withString:]: nil NSString given.


PerlButtonTest has exited due to signal 5 (SIGTRAP).

the way I understand things, this is more a Cocoa problem then a Camelbones problem.
Camelbones just passes arguments through to the Objective-C function, and if "setString" does not like null strings, there is little CB can do about it.
You will have to do argument checking by yourself to make sure things work.


Something like
$self->{'textBoxen'}->setString(defined $file ? $file :: '');

What would be nice, though, is if CB could somehow suppress the SIGTRAP and wrap it into a normal Perl exception, that we could catch
with an eval-block.


Anyone knows how to do that?

Thilo



Reply via email to