• 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: New Tiger NSDocument API's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >New Tiger NSDocument API's (From: Philip Ershler <email@hidden>)

  • Prev by Date: Re: New Tiger NSDocument API's
  • Next by Date: Drawing the focus ring
  • Previous by thread: Re: New Tiger NSDocument API's
  • Next by thread: Drawing the focus ring
  • Index(es):
    • Date
    • Thread