views:

54

answers:

1

This Apple tech note:

http://developer.apple.com/library/ios/#qa/qa2010/qa1699.html

suggests storing "internal" user documents in a subdirectory off of ~/Library. But I can't find one of the pre-created search domains that would get me this. What's the best/most correct/least likely to ever break way of constructing this path?

Thanks.

+3  A: 

The correct way is

NSString* path = [NSSearchPathForDirectoriesInDomains(
                    NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];

However, [@"~/Library" stringByExpandingTildeInPath] also works.

KennyTM
NSlibraryDirectory is documented to point to the root /Library, not the user version. Are they semantically equivalent in this case?
quixoto
I have confirmed that `NSLibraryDirectory` combined with `NSUserDomainMask` does the right thing here. Thanks Kenny.
quixoto