diff options
Diffstat (limited to 'UnitTesting/GTMNSObject+UnitTesting.m')
-rw-r--r-- | UnitTesting/GTMNSObject+UnitTesting.m | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/UnitTesting/GTMNSObject+UnitTesting.m b/UnitTesting/GTMNSObject+UnitTesting.m index 3796839..5e628d3 100644 --- a/UnitTesting/GTMNSObject+UnitTesting.m +++ b/UnitTesting/GTMNSObject+UnitTesting.m @@ -428,13 +428,11 @@ static NSString *gGTMUnitTestSaveToDirectory = nil; @synchronized([self class]) { if (!gGTMUnitTestSaveToDirectory) { #if GTM_IPHONE_SDK - // Developer build, use their home directory Desktop. - gGTMUnitTestSaveToDirectory - = [[[[[NSHomeDirectory() stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent] - stringByDeletingLastPathComponent] - stringByAppendingPathComponent:@"Desktop"]; + // About the only thing safe for the sandbox is the documents directory. + NSArray *documentsDirs + = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, + NSUserDomainMask, YES); + gGTMUnitTestSaveToDirectory = [documentsDirs objectAtIndex:0]; #else NSArray *desktopDirs = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, |