| Index: experimental/iOSSampleApp/Shared/skia_ios.mm
|
| diff --git a/experimental/iOSSampleApp/Shared/skia_ios.mm b/experimental/iOSSampleApp/Shared/skia_ios.mm
|
| index 45675fa61a0b4ef817997c899b682c32f2443784..2b793483e68e2085391f59440af0e713edab41ef 100644
|
| --- a/experimental/iOSSampleApp/Shared/skia_ios.mm
|
| +++ b/experimental/iOSSampleApp/Shared/skia_ios.mm
|
| @@ -5,14 +5,24 @@ int main(int argc, char *argv[]) {
|
| signal(SIGPIPE, SIG_IGN);
|
| NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
| application_init();
|
| +
|
| // Identify the documents directory
|
| NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
| NSString *docsDir = [dirPaths objectAtIndex:0];
|
| - const char *d = [docsDir UTF8String];
|
| - IOS_launch_type launchType = set_cmd_line_args(argc, argv, d);
|
| - int retVal = launchType == kApplication__iOSLaunchType
|
| - ? UIApplicationMain(argc, argv, nil, nil) : (int) launchType;
|
| + NSString *resourceDir = [docsDir stringByAppendingString:@"/resources"];
|
| + const char *d = [resourceDir UTF8String];
|
| +
|
| + // change to the dcouments directory. To allow the 'writePath' flag to use relative paths.
|
| + NSFileManager *filemgr = [NSFileManager defaultManager];
|
| + int retVal = 99;
|
| + if ([filemgr changeCurrentDirectoryPath: docsDir] == YES)
|
| + {
|
| + IOS_launch_type launchType = set_cmd_line_args(argc, argv, d);
|
| + retVal = launchType == kApplication__iOSLaunchType
|
| + ? UIApplicationMain(argc, argv, nil, nil) : (int) launchType;
|
| + }
|
| application_term();
|
| + [filemgr release];
|
| [pool release];
|
| return retVal;
|
| }
|
|
|