• 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
NSURL-based replacement for NSTemporaryDirectory()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURL-based replacement for NSTemporaryDirectory()?


  • Subject: NSURL-based replacement for NSTemporaryDirectory()?
  • From: Sean McBride <email@hidden>
  • Date: Thu, 05 Apr 2012 18:59:29 -0400
  • Organization: Rogue Research Inc.

Hi all,

I'm trying to get rid of the last bits of NSString path-based file code, and am looking to replace NSTemporaryDirectory().

I've tried this:

NSError* error = nil;
NSURL* url = [fileManager URLForDirectory:NSItemReplacementDirectory
                                 inDomain:NSUserDomainMask
                        appropriateForURL:nil
                                   create:YES
                                    error:&error];

but it returns nil (with no error, bah).  If I pass something for 'appropriateForURL', it does work, but what to pass when you just want any old temp directory?

(Since someone will ask: my exact usage case is in unit test code, I need to test a file reader/writer, and just need a place to dump my files.)

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSURL-based replacement for NSTemporaryDirectory()?
      • From: Charles Srstka <email@hidden>
  • Prev by Date: Re: Help debugging EXC_BAD_ACCESS
  • Next by Date: Re: NSURL-based replacement for NSTemporaryDirectory()?
  • Previous by thread: Re: UITabBars and UITableViews
  • Next by thread: Re: NSURL-based replacement for NSTemporaryDirectory()?
  • Index(es):
    • Date
    • Thread