On Jan 11, 2010, at 05:43, Jeffrey Andrews wrote:

> I am stumped.  I am trying to open another document from within a document.  
> My AppController implements the delegate method
> 
> -(BOOL) application:(NSApplication*) sender openFile:(NSString*)path
> {
>       NSLog(@"AppController - application:openFile - %@", path);
>       NSDocumentController* dc = [NSDocumentController 
> sharedDocumentController];
>       id doc = [dc openDocumentWithContentsOfURL:[NSURL URLWithString:path] 
> display:YES];
>       return (doc != nil);
> }

...

> How else should I handle opening another window with the file specified?

Yes, but you didn't say what happens. Does the delegate method get invoked? Is 
'doc' nil? What happens if you use the non-deprecated 
'openDocumentWithContentsOfURL:display:error:' instead? Is there an error 
returned? Shouldn't you be using 'fileURLWithPath:' instead of 'URLWithString'? 
Etc, etc.


_______________________________________________

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