I'm using FMDB wrapper
class for my iPad
application. I'm having table
which contains nearly 10000 records. Each record is having 140 fields. I'm using Modal class
to store the retrieved values like,
NSString *query = [NSString stringWithFormat:@"select * from table"];
FMResultSet *results = [db executeQuery:query];
while([results next]) {
ModalClass *modal = [[ModalClass alloc] init];
[modal setField1:value1];
[modal setField2:value2];
[modal setField3:value3];
[modal setField4:value4];
.
.
.
.
.
[modal setField139:value139];
[modal setField140:value140];
[array addObject:modal];
}
I've used some options i know, performSelectorOnMainThread
, dispatch_async()
and some other multithreading techniques. But nothing helped me to make this efficient.
In Simulator, it takes 5 seconds. But when it comes to device it takes nearly 20 seconds.
Database is given by client, so i could not change or modify any tables.
Can anyone help me to make this efficient. Waiting for 20 seconds is very disgusting.
Thanks.