Tag: Objective-C/ファイル
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:filename];
NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; NSString *filePath = [resourcePath stringByAppendingPathComponent:filename];
NSError *error = nil; [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];