- (void) copyDatabaseIfNeeded
{
BOOL success;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:ABC.Sqlite];
success = [fileManager fileExistsAtPath:writableDBPath];
if (success) return;
// The writable database does not exist, so copy the default to the appropriate location.
NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:ABC.Sqlite];
success = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&error];
if (success)
{
NSURL *url=[NSURL URLWithString:WSURL2];
} else
{
NSLog(@"Failed to create writable database file with message '%@'.", [error localizedDescription]);
}
}
Мне нужно добавить код для просмотра Sqlite File ??Невозможно увидеть SQLite-файл в iTunes
Я попробовал, добавив их в Plist: UIFileSharingEnabled
, CFBundleDisplayName
Как я просматривать мой файл SQLite в Itunes?
Приглашение ссылки: How to enable file sharing for my app?, UIFileSharingEnabled has no effect
Если я включен обмен вариант в мое приложение резервного копирования данных приложений в ПК ITunes файл, будет AppStore отторгает приложение?
Сохраните файл в папке «Документы» в приложении? Покажите соответствующий код. – rmaddy
Я отредактировал код, пожалуйста, проверьте один раз, мне нужно добавить любой код для просмотра Sqlite File ?? @rmaddy – Sanju