Can't set directory for runModalSavePanelForSaveOperation
Can't set directory for runModalSavePanelForSaveOperation
- Subject: Can't set directory for runModalSavePanelForSaveOperation
- From: roberto toro <email@hidden>
- Date: Mon, 18 Aug 2003 18:49:19 +0200
Hi,
I need to create a document (a NSTextView inside) and to save it before
doing any
editing. When the SavePanel appears, it points always to the root...
I create the document like this:
[[NSDocumentController sharedDocumentController] newDocument:nil];
MyDocument *doc=[[NSDocumentController sharedDocumentController]
currentDocument];
[doc runModalSavePanelForSaveOperation:NSSaveOperation
delegate:self
didSaveSelector:@selector(document:didSave:contextInfo:)
contextInfo:nil];
... even if a try to prepare the panel, it always points to the root...
- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel
{
NSDocumentController *dc;
NSString *path;
dc=[NSDocumentController sharedDocumentController];
path=[dc currentDirectory];
[savePanel setDirectory:path];
return YES;
}
... and the path is a null string.
any ideas? Thanks a lot!
roberto
_______________________________________________
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.