Re: New Tiger NSDocument API's
Re: New Tiger NSDocument API's
- Subject: Re: New Tiger NSDocument API's
- From: Sherm Pendley <email@hidden>
- Date: Mon, 13 Jun 2005 01:19:09 -0400
On Jun 13, 2005, at 12:53 AM, Philip Ershler wrote:
- (BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:
(NSString *)typeName error:(NSError **)outError
{
CFReadStreamRef myStream;
Boolean openResult;
// How do I get the CFURLRef fileURL?
You need to override the correct method for how you want to work.
If you want to work with URLs, override the NSDocument method: -
readFromURL:ofType:error:. You'll receive an NSURL instance as the
first parameter, which is toll-free bridged to CFURL, so all that's
needed is a simple typecast.
If you want to work with file wrappers, override NSDocument's -
readFromFileWrapper:ofType:error:, as you've done here, and use
NSFileWrapper's methods: -fileWrappers to get at the sub-wrappers in
a directory wrapper, and -regularFileContents method to get at the
data in a regular file wrapper.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden