I'm having some trouble finding my sqlite file. When I run de app with iOS 5 simulator it runs ok but when I run it on iOS 5.1 it can't find the sqlite file. I'm using this code to find the file.
- (NSString *) getDatabasePath {
NSString* databaseName = @"bohn_db.bin.sqlite";
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
return [documentsDir stringByAppendingPathComponent:databaseName];
}
On iOS 5 works and on iOS 5.1 it doesn't, I tried to copy the file from de main bundle resource path to the documents path (above path) and it does not work cause the file its not even found in the main bunlde resource path, but the file is there. What happens on iOS 5.1??
Thanks in advance!!
Remove app from simulator and build and Put timer for getDatabasePath for 5 sec. I think it will work.