Convert SQLite to CoreData
NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
NSString* path = [NSString stringWithFormat:@"%@/CoreDataSourceFile.sqlite", bundlePath];
SQLiteDatabase *database = [[SQLiteDatabase alloc] initWithPath:path];
NSArray *result = [database performQuery:@"SELECT * FROM entity"];
for (NSArray *row in result)
{entityText
NSString *entityText = [row objectAtIndex:1];
const char *macString = [entityText cStringUsingEncoding:NSMacOSRomanStringEncoding];
NSString *cstr = [[NSString alloc]initWithCString:macString encoding:NSUTF8StringEncoding];
[CoreData addToCoreData:cstr];
}
Written by Rudenko Michael
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#