Hi All,

I'm running into a strange problem that I though perhaps someone else might 
have run into and might have a solution for.

If I were writing a document based application in Objective-C and wanted to the 
user to be able to cancel the opening of a document, I could do something like 
this (which I can confirm works fine):

- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError 
**)outError
{
    // Loading code here...

    *outError = [NSError errorWithDomain:NSCocoaErrorDomain 
code:NSUserCancelledError userInfo:nil];
    return NO;
}

The (what seems to me) obvious thing to do in MonoMac would be to implement 
this:

public override bool ReadFromData (NSData data, string typeName, out NSError 
outError)
{
        // Loading code here...

        outError = NSError.FromDomain(NSError.CocoaErrorDomain,1376);
        return false;
}

However, when I do so, my app crashes with the following stack trace:

#0  0x9287dfd5 in __wait4 ()
#1  0x93be04ec in waitpid$UNIX2003 ()
#2  0x0009fe9b in mono_handle_native_sigsegv (signal=11, ctx=0xbfffea5c) at 
mini-exceptions.c:2192
#3  0x00004f6e in mono_sigsegv_signal_handler (_dummy=10, info=0xbfffea1c, 
context=0xbfffea5c) at mini.c:5917
#4  <signal handler called>
#5  0x9249cd44 in objc_msgSend ()
#6  0x991622cc in -[NSDocumentController(NSInternal) 
_fixedFailureReasonFromError:] ()
#7  0x9916b5f4 in -[NSDocumentController _willPresentOpeningError:forURL:] ()
#8  0x9916b197 in -[NSDocumentController 
_openDocumentsWithContentsOfURLs:presentErrors:completionHandler:] ()
#9  0x9915f749 in -[NSDocumentController openDocument:] ()
(Rest of stack trace omitted)

Has anyone else run into this problem, and if so were you able to find a 
solution/workaround?

Thanks,
Jon...
_______________________________________________
Mono-osx mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-osx

Reply via email to