• 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
Editing files in place using NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Editing files in place using NSDocument


  • Subject: Editing files in place using NSDocument
  • From: "Stephen F. Booth" <email@hidden>
  • Date: Thu, 16 Feb 2006 16:50:59 -0800

I would like to edit a portion of a file's data in place (specifically the tags inside a FLAC file) using the NSDocument architecture. I have successfully overridden

- (BOOL) readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError

to read in the metadata.  I have tried overriding

- (BOOL) writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error: (NSError **)outError

for writing the modified metadata to absoluteOriginalContentsURL. The file is indeed modified and saved (correctly) on disk, but the save operation fails and displays an error sheet. I believe this is because the application wants the NSDocument's data to be written to absoluteURL, which is something like "/tmp/501/Tag_X" (whereas absoluteOriginalContentsURL is "/tmp/foo.flac"). However, I obviously don't want to have to deal with copying megabytes of FLAC data to absoluteURL only to have it copied back to the original.

Does anyone have ideas/sample code/something I've missed?

Thanks,
Stephen
_______________________________________________
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


  • Prev by Date: Re: why would anyone want to do that?
  • Next by Date: Re: Cross-platform?
  • Previous by thread: Re: [Solved] Importing a .nib file
  • Next by thread: Displaying Text Vertically
  • Index(es):
    • Date
    • Thread