Hello All,

I have a strange crash happening while trying load an open file window/sheet 
(NSOpenPanel). 
I've got a simple AppController class, which is set as the Application's 
delegate. This is all there is to the controller, at this point:

#import "AppController.h"


@implementation AppController

- (void) openPanelDidEnd:(NSOpenPanel*)openPanel returnCode:(int)returnCode 
contextInfo:(void*)x
{
  if(returnCode == NSOKButton)
  {
    NSString* path = [openPanel filename];
    // do smart stuff here...
    NSLog(@"Tried to import midi file %@", path);
  }
}

- (IBAction) showMIDIImportPanel:(id)sender
{
  NSOpenPanel* panel = [NSOpenPanel openPanel];
  [panel beginSheetForDirectory:nil file:nil types:[NSSound 
soundUnfilteredTypes] modalForWindow:[NSApp mainWindow] modalDelegate:self 
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) 
contextInfo:NULL];
}

@end

I actually have no idea why the NSAccessibility stuff is coming up, and the 
docs didn't shed much light for me. The bt is below. 
It loads the sheet, then lists the files in the selected directory, then 
crashes. It works fine if I disable access for assistive devices on the system, 
but is there some legit way around this? Some exception I should be handling? 
This is the first time I've run into any accessibility stuff.
Also, just in case anyone knows, when it does work (with assistive devices 
disabled), it doesn't actually recognize midi files. Does anyone know what, if 
not [NSSound soundUnfilteredTypes], what "types" I would indicate for opening 
midi files?

Thanks in advance for any thoughts.

J.


#0  0x97c54a16 in -[NSException raise] ()
#1  0x931ac55c in NSAccessibilityAttributeValue ()
#2  0x933c443f in CopyAppKitUIElementAttributeValueNoCatch ()
#3  0x933c69d7 in CopyAttributeValue ()
#4  0x90461ad3 in _AXXMIGCopyAttributeValue ()
#5  0x9046bb96 in _XCopyAttributeValue ()
#6  0x9043dc39 in mshMIGPerform ()
#7  0x97b758db in __CFRunLoopRun ()
#8  0x97b73864 in CFRunLoopRunSpecific ()
#9  0x97b73691 in CFRunLoopRunInMode ()
#10 0x91a39f0c in RunCurrentEventLoopInMode ()
#11 0x91a39cc3 in ReceiveNextEventCommon ()
#12 0x91a39b48 in BlockUntilNextEventMatchingListInMode ()
#13 0x93160ac5 in _DPSNextEvent ()
#14 0x93160306 in -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#15 0x9312249f in -[NSApplication run] ()
#16 0x9311a535 in NSApplicationMain ()
#17 0x00002828 in main () at main.m:13


-----------------------------------
James B Maxwell
Composer/Doctoral Student
School for the Contemporary Arts (SCA)
School for Interactive Arts + Technology (SIAT)
Simon Fraser University
jbmaxw...@rubato-music.com
jbmax...@sfu.ca

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to