• 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
Avoiding temp file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoiding temp file


  • Subject: Avoiding temp file
  • From: Johan Kool <email@hidden>
  • Date: Fri, 2 Jul 2004 00:13:24 +0200

Hello,

Is there a way where I can avoid writing to a temporary file?

- (NSData *)dataRepresentationOfType:(NSString *)aType {
// A bit (w)hacky this way!!!
[[mainArrayController content] writeToFile:@"/tmp/temp.xml" atomically:YES];
return [[NSString stringWithContentsOfFile:@"/tmp/temp.xml"] dataUsingEncoding:NSUTF8StringEncoding];
}

I want to use dataRepresentationOfType: instead of writeToFile:ofType: as another of my filetypes is done most easily returning NSData. I suppose having both methods at the same time doesn't work, right?

Thanks,

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


  • Follow-Ups:
    • Re: Avoiding temp file
      • From: "Louis C. Sacha" <email@hidden>
  • Prev by Date: Re: binding and too many relationship insertion
  • Next by Date: Re: Saving arrays with NSUserDefaults?
  • Previous by thread: changing the desktop picture
  • Next by thread: Re: Avoiding temp file
  • Index(es):
    • Date
    • Thread