Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with Xcode 6 Beta #25

Open
aentan opened this issue Jun 4, 2014 · 2 comments
Open

Exception with Xcode 6 Beta #25

aentan opened this issue Jun 4, 2014 · 2 comments

Comments

@aentan
Copy link

aentan commented Jun 4, 2014

Trying to extract iOS 8 assets. Doesn't quite work.

@adamek314
Copy link

App will open in iOS Simulator Version 8.0 (541), but it crashes as soon as you tap any save button.

@tomguthrie
Copy link

Quick fix because -[AppDelegate homeDirectory] isn't working properly and it looks like the simulator stops you trying to write outside of potential iOS sandbox. Just replace this in AppDelegate.m:

- (NSString *) saveDirectory:(NSString *)subDirectory
{
    NSString *saveDirectory = NSProcessInfo.processInfo.environment[@"ARTWORK_DIRECTORY"];

    if (!saveDirectory)
    {
        saveDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    }
    if (subDirectory)
        saveDirectory = [saveDirectory stringByAppendingPathComponent:subDirectory];

    if (![[NSFileManager defaultManager] fileExistsAtPath:saveDirectory])
    {
        NSError *error = nil;
        BOOL created = [[NSFileManager defaultManager] createDirectoryAtPath:saveDirectory withIntermediateDirectories:YES attributes:nil error:&error];
        if (!created)
            NSLog(@"%@\n%@", error, error.userInfo);
    }

    NSLog(@"Saving to: %@", saveDirectory);

    return saveDirectory;
}

It logs the directory where it saves to so you can find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants