There is always a pre-written function at AppDelegate:
(NSString *)applicationSupportDirectory {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : NSTemporaryDirectory();
return [basePath stringByAppendingPathComponent:@"SyncFile"];
}
However, I can't call this method outside this class:
id _appDelegate = (SyncFile_AppDelegate *)[[NSApplication sharedApplication] delegate];
NSLog(@"%@", [_appDelegate applicationSupportDirectory]);
The compiler warned me that it can't find method applicationSupportDirectory... Does anyone know what's wrong with my code? Thank you very much!