Re: NSURLDownload -> NDDocument?
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.