Index: experimental/iOSSampleApp/Shared/skia_ios.mm |
diff --git a/experimental/iOSSampleApp/Shared/skia_ios.mm b/experimental/iOSSampleApp/Shared/skia_ios.mm |
index 65b3e8a034cc1c1ca9c97622091811bf3096eeb5..4fce1392d81fc692044b9dfadb4cb61ad6de83dd 100644 |
--- a/experimental/iOSSampleApp/Shared/skia_ios.mm |
+++ b/experimental/iOSSampleApp/Shared/skia_ios.mm |
@@ -1,14 +1,19 @@ |
#import <UIKit/UIKit.h> |
#include "SkApplication.h" |
-extern void save_args(int argc, char *argv[]); |
+extern bool set_cmd_line_args(int argc, char *argv[], const char* dir); |
int main(int argc, char *argv[]) { |
signal(SIGPIPE, SIG_IGN); |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
application_init(); |
- save_args(argc, argv); |
- int retVal = UIApplicationMain(argc, argv, nil, nil); |
+ // Identify the documents directory |
+ NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); |
+ NSString *docsDir = [dirPaths objectAtIndex:0]; |
+ const char *d = [docsDir UTF8String]; |
+ |
+ bool ranCommand = set_cmd_line_args(argc, argv, d); |
+ int retVal = ranCommand ? 0 : UIApplicationMain(argc, argv, nil, nil); |
application_term(); |
[pool release]; |
return retVal; |