I have the following values in my SQLite Database;
Column1------ Column2
"1" ------- "One"
"2" -------"Two"
"3" -------- "Three"
etc..
Now i will need to read all these values and save it into a NSArray, NSMutableArray etc. But when i store it in one of the above mentioned arrays the order of data should not change. It should always remain as it was in the database.
So my question is that to what should i save it to without changing the order of the data ? Is it a NSArray or a NSMutableArray ?
The Query would be a simple select All statement;
FMResultSet *results = [db executeQuery:@"SELECT * FROM PersonTable"];
while([results next])
{
Name *nam= [[Name alloc] init];
nam.fname= [results stringForColumn:@"fname"];
nam.lname= [results stringForColumn:@"lname"];
[mutArray addObject:nam];
}
[db close];
}else {
NSLog(@"DB Close");
}
Finally I will be returning a MutableArray, in this case it's mutArray