Thursday, November 3, 2011

NSTemporaryDirecotory

A lenyeg, hogy Simulator-ban nem az app sandbox-aba mutat mint pl az NSHomeDirectory()

Igy amig a device-on:
NSHomeDirectory() == /var/mobile/Applications/[APP_ID]
NSTemporaryDirectory() == /private/var/mobile/Applications/[APP_ID]/tmp/
addig iOS Simulatorban:
NSHomeDirectory() == /Users/[USER]/Library/Application Support/iPhone Simulator/5.0/Applications/[APP_ID]
NSTemporaryDirectory == /var/folders/oA/[ID]/-Tmp-/

Do you use the temporary directory? On Simulator NSTemporaryDirectory() returns Mac OS X tmp, a path in /var, which is outside the application sandbox.

#if TARGET_IPHONE_SIMULATOR
NSString *tmpPath = [NSHomeDirectory() stringByAppendingPathComponent: @"tmp"];
#else
NSString *tmpPath = NSTemporaryDirectory();
#endif

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.