21 #if !defined(__has_feature) || !__has_feature(objc_arc)
22 #error "Nimbus requires ARC support."
26 NSString* resourcePath = [(nil == bundle ? [NSBundle mainBundle] : bundle) resourcePath];
27 return [resourcePath stringByAppendingPathComponent:relativePath];
31 static NSString* documentsPath = nil;
32 if (nil == documentsPath) {
33 NSArray* dirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
36 documentsPath = [dirs objectAtIndex:0];
38 return [documentsPath stringByAppendingPathComponent:relativePath];
42 static NSString* libraryPath = nil;
43 if (nil == libraryPath) {
44 NSArray* dirs = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
47 libraryPath = [dirs objectAtIndex:0];
49 return [libraryPath stringByAppendingPathComponent:relativePath];
53 static NSString* cachesPath = nil;
54 if (nil == cachesPath) {
55 NSArray* dirs = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
58 cachesPath = [dirs objectAtIndex:0];
60 return [cachesPath stringByAppendingPathComponent:relativePath];
NSString * NIPathForBundleResource(NSBundle *bundle, NSString *relativePath)
Create a path with the given bundle and the relative path appended.
NSString * NIPathForLibraryResource(NSString *relativePath)
Create a path with the Library directory and the relative path appended.
NSString * NIPathForDocumentsResource(NSString *relativePath)
Create a path with the documents directory and the relative path appended.
NSString * NIPathForCachesResource(NSString *relativePath)
Create a path with the caches directory and the relative path appended.