- (void)getDBpath { NSString *docsDir; NSArray *dirPaths; // Get the documents directory dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); docsDir = [dirPaths objectAtIndex:0]; // Build the path to the database file databasePath = [[NSString alloc] initWithString: [docsDir stringByAppendingPathComponent: @"mainframe.db"]]; //NSLog(@"DB full path name: %@", databasePath); NSFileManager *fileMgr = [NSFileManager defaultManager]; BOOL success = [fileMgr fileExistsAtPath:databasePath]; if (!success) { NSLog(@"Cannot locate database file '%@'.", databasePath); } }
沒有留言:
張貼留言