0

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? Commented Dec 27, 2012 at 6:01
  • what you want exact? at 1 index you want to set @"ALL"? Commented 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 database Commented Dec 27, 2012 at 6:17

2 Answers 2

1

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
  }
}
Sign up to request clarification or add additional context in comments.

2 Comments

@Roma: is my answer helped you ? or you got any other ways ?
@Roma: thanks for your comment. You can share your solution as your answer,
0

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]
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.