xcode - How to return the App Temp directory -
i trying determine place script file in location can read/write while being sandboxed. while reading apple documentation, seen below:
some path-finding apis (above posix layer) refer app-specific locations outside of user’s home directory. in sandboxed app, example, nstemporarydirectory function provides path directory outside of user’s home directory specific app , within sandbox; have unrestricted read/write access current user. behavior of these path-finding apis suitably adjusted app sandbox , no code change needed.
so need use nstemporarydirectory function return application temp directory.. can't seem figure out how other documentation nstemporarydirectory:
nstemporarydirectory returns path of temporary directory current user.
nsstring * nstemporarydirectory (void); return value string containing path of temporary directory current user. if no such directory available, returns nil.
can please assist me in figuring out temp directory may located, or how find sort of nslog?
please advise.
how simply:
nsstring *tempdir = nstemporarydirectory(); nslog(@"tempdir='%@'", tempdir);
edit: updated answer store value in variable, per op request.
Comments
Post a Comment