i have an array of database records which adds values in table view. Now i want to add @"All" object in the cell at index 0 so that when i select this value i can get all the records from database.
3
-
cell at index 0 or values as per the index?junaidsidhu– junaidsidhu2012-12-27 06:01:41 +00:00Commented Dec 27, 2012 at 6:01
-
what you want exact? at 1 index you want to set @"ALL"?Hiren– Hiren2012-12-27 06:02:13 +00:00Commented Dec 27, 2012 at 6:02
-
i have used groupby query for filteration now i want to add an object All at row 0 and then after the groupby values should get added. Now when i click to all i should get all the records from the databaseRoma– Roma2012-12-27 06:17:34 +00:00Commented Dec 27, 2012 at 6:17
Add a comment
|
2 Answers
In your database method before the sqlite3_step statement add an object to the return array.
sqlite3_prepare(//prepare statements)
{
//add object here
[returnArray addObject:yourExtraObject];
while(sqlite3_step(sqlStatement);
{
//add other objects here
}
}
The below code you can use where you are using query to group your data
NSDictionary *dicTemp = [[NSDictionary alloc] initWithObjectsAndKeys:@"ALL",@"Course", nil];
[arrtimesList addObject:dicTemp];
The below code3 you can you code at didSelectRow
if([strName isEqualToString:@"ALL"])
{
[self displayTimeList];
[tblTimeslist reloadData]
}