• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Open new document from within another document.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open new document from within another document.


  • Subject: Re: Open new document from within another document.
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 11 Jan 2010 09:41:15 -0800

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 (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

References: 
 >Open new document from within another document. (From: Jeffrey Andrews <email@hidden>)

  • Prev by Date: Re: Differentiate FAT16 and FAT32
  • Next by Date: Re: Differentiate FAT16 and FAT32
  • Previous by thread: Open new document from within another document.
  • Next by thread: Re: Open new document from within another document.
  • Index(es):
    • Date
    • Thread