Created
April 9, 2013 10:16
-
-
Save maxhuk/5344650 to your computer and use it in GitHub Desktop.
Fast path composition for common file locations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDirectories.h | |
// | |
// Created by Maksym Huk on 3/31/13. | |
// Copyright (c) 2013 Maksym Huk. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
NSString *AppendToDocumentsDirectory(NSString *path); | |
NSString *AppendToResourcesDirectory(NSString *path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDirectories.m | |
// | |
// Created by Maksym Huk on 3/31/13. | |
// Copyright (c) 2013 Maksym Huk. All rights reserved. | |
// | |
#import "AppDirectories.h" | |
NSString *AppendToDocumentsDirectory(NSString *path) { | |
return [[[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject] path] stringByAppendingPathComponent:path]; | |
} | |
NSString *AppendToResourcesDirectory(NSString *path) { | |
return [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:path]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment