What do I need to set up the database in my ios project? I know I have to make a copy of the database file but do I need to rewrite the same setup code in each view controller where I plan to actually retrieve and save data?
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDir = [documentPaths objectAtIndex:0];
self.databasePath = [documentDir stringByAppendingPathComponent:@"gameDefault.sqlite"];
[self createAndCheckDatabase];
I have this in my appdelegate, but do I need to have the same code in my facebook view controller where I plan to save user info?