NSSaveView and odd NSCFArray errors
NSSaveView and odd NSCFArray errors
- Subject: NSSaveView and odd NSCFArray errors
- From: Adam Knight <email@hidden>
- Date: Wed, 17 Sep 2003 13:27:49 -0500
I have the following code:
- (IBAction)saveAIFF:(id)sender
{
NSSavePanel * panel = [NSSavePanel savePanel];
[panel setRequiredFileType:@"aiff"];
[panel beginSheetForDirectory:NSHomeDirectory()
file:@"Untitled.aiff" modalForWindow:fWindow modalDelegate:self
didEndSelector:@selector(didEndSaveSheet:returnCode:contextInfo:)
contextInfo:@"AIFF"];
}
- (void)didEndSaveSheet:(NSSavePanel *)theSavePanel
returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
NSLog(returnCode);
}
The sheet comes up properly but AFTER that the icons in the columns go
away, the text grays out, and any input (keyboard or clicking) cause
the following error to pop up in the console:
2003-09-17 00:43:22.258 MyProject[522] Exception raised during posting
of notification. Ignored. exception: *** -[NSCFArray objectAtIndex:]:
index (4) beyond bounds (0)
I've seen this question asked before in the archives and it was solved
with a bit of code. I tried that code almost verbatim (changed the
window object) and have the same issue. I have no idea what's going
on. This is a Cocoa Document-based app and the first function is
triggered from a menu item.
Anyone else run into this? Granted, this is my first attempt at using
this function, but it really shouldn't be this hard. This is exactly
how other programs seem to use it and it seems only this one fails, so
it's obviously something I'm monkeying but I have no idea what it could
be. I started with this:
[[NSSavePanel savePanel] beginSheetForDirectory:@"" file:@""
modalForWindow:fWindow modalDeligate:self
didEndSelector:@selector(didEndSaveSheet:returnCode:contextInfo:)
contextInfo:NULL];
It failed as well, hence me looking for other solutions. That same
code works in a sample project (the Clipboard Viewer one). I'm fairly
certain that I'm passing an argument wrong, but I can't figure out
which one.
Thanks for any help.
--
Adam
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.