• 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: NSURLDownload -> NDDocument?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLDownload -> NDDocument?


  • Subject: Re: NSURLDownload -> NDDocument?
  • From: Koen van der Drift <email@hidden>
  • Date: Sun, 6 Jul 2003 11:40:01 -0400

On Sunday, July 6, 2003, at 07:57 AM, Koen van der Drift wrote:

Hi,

How do I create a new NSDocument using the data received from a NSURLDownload? Neither NSDocument or NSDocumentController seem to have methods that handle this because NSURLDownload creates an NSData object. NSDocumentController has a method openDocumentWithContentsOfURL but I am not sure if I can use that in this case. Same for NSDocument which has a method initWithContentsOfURL.



I think I solved it, I use the following code:

IDDocument *newDoc = [[IDDocument alloc] init];

[newDoc makeWindowControllers];
[newDoc loadDataRepresentation:receivedData ofType:nil];

[[NSDocumentController sharedDocumentController] addDocument: newDoc];
[newDoc showWindows];


This works, but I am not sure if I missed anything when creating/setting up the newDoc.


thanks,

- Koen.
_______________________________________________
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.

References: 
 >NSURLDownload -> NDDocument? (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Speed up drawing of View with multiple NSBezierPaths
  • Next by Date: Re: Drawing Arcs
  • Previous by thread: NSURLDownload -> NDDocument?
  • Next by thread: Problem with NSNumberFormatter - no result even after searching the complete cocoa mamasam archive
  • Index(es):
    • Date
    • Thread