10.5.2 broke my open panel code!
10.5.2 broke my open panel code!
- Subject: 10.5.2 broke my open panel code!
- From: Nathaniel Gottlieb-Graham <email@hidden>
- Date: Thu, 14 Feb 2008 21:33:13 -0500
I'm writing an application that prompts the user at one point to
select a movie or image. Under 10.5.1, navigating to the file in the
dialog box manually as well as clicking on those helpful little
"Photos" and "Movies" entries under the Media group at the bottom of
the source list both worked. However, upon upgrading to 10.5.2,
clicking on those quick collections in the source list causes my app
to hang indefinitely. The console reports several copies of:
[NSCFString stopObservingModelObject:]: unrecognized selector sent to
instance 0x1075330
…as well as s bunch of GC compatibility mismatch warnings due to a
couple of my installed inputManagers which never caused any problems
before. Here's the code that triggers the open panel for your preusal:
- (IBAction)askForStartingFile:(id)sender {
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection: NO];
[panel setCanChooseDirectories: NO];
[panel beginSheetForDirectory:nil
file:nil
types:[QTMovie movieFileTypes:QTIncludeStillImageTypes]
modalForWindow:[NSAppmainWindow]
modalDelegate:self
didEndSelector:@selector(openPanelDidEnd:
returnCode:
contextInfo:)
contextInfo:nil];
}
- (void)openPanelDidEnd:(NSOpenPanel*)panel
returnCode:(int)returnCode
contextInfo:(void*)contextInfo {
if (returnCode == NSOKButton) {
QTMovie *newMovie = [QTMovie movieWithFile:[panel filename]
error:nil];
NSDocumentController *documentController = [NSDocumentController
sharedDocumentController];
// create the new document
MyDocument *currentDoc = [documentController
makeUntitledDocumentOfType:@"myProject" error:nil];
if (currentDoc) {
[documentController addDocument:currentDoc];
[currentDoc setMovie:newMovie];
[currentDoc makeWindowControllers];
[currentDoc updateChangeCount:NSChangeCleared];
[currentDoc showWindows];
} else {
NSRunAlertPanel(@"Could not make new document", @"Larger
explanation goes here", nil, nil, nil);
}
// Is there a better way to close this window? It looks sort of
dangerous.
[[[NSApp windows] objectAtIndex:0] close];
}
}
Any ideas?
Thanks,
Nathaniel_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden