FROM : Oleg Krupnov
DATE : Fri Jan 09 08:54:04 2009
Here is my code:
//-------------------------------------------------------------------------------------------------
- (IBAction)scanFolder:(id)sender
{
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:NO];
[openPanel setAllowsMultipleSelection:NO];
[openPanel beginSheetForDirectory:nil
file:nil
modalForWindow:[sourceView window]
modalDelegate:self
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo:NULL];
}
//-------------------------------------------------------------------------------------------------
- (void)openPanelDidEnd:(NSOpenPanel*)panel returnCode:(int)returnCode
contextInfo:(void*)contextInfo
{
if (returnCode == NSOKButton)
{
[self activatePath:[[panel filenames] objectAtIndex:0]];
}
}
It puzzles me that the application is terminated unexpectedly without
any error messages in the console after the stack is unwinded up from
the openPanelDidEnd function.
What might I be doing wrong?
DATE : Fri Jan 09 08:54:04 2009
Here is my code:
//-------------------------------------------------------------------------------------------------
- (IBAction)scanFolder:(id)sender
{
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:NO];
[openPanel setAllowsMultipleSelection:NO];
[openPanel beginSheetForDirectory:nil
file:nil
modalForWindow:[sourceView window]
modalDelegate:self
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo:NULL];
}
//-------------------------------------------------------------------------------------------------
- (void)openPanelDidEnd:(NSOpenPanel*)panel returnCode:(int)returnCode
contextInfo:(void*)contextInfo
{
if (returnCode == NSOKButton)
{
[self activatePath:[[panel filenames] objectAtIndex:0]];
}
}
It puzzles me that the application is terminated unexpectedly without
any error messages in the console after the stack is unwinded up from
the openPanelDidEnd function.
What might I be doing wrong?
| Related mails | Author | Date |
|---|---|---|
| Oleg Krupnov | Jan 9, 08:54 | |
| Corbin Dunn | Jan 9, 17:18 | |
| Oleg Krupnov | Jan 9, 17:35 |






Cocoa mail archive

