I have sorted an Array in Ascending order. I need to display the first value of the table to be colored. How can I do this
My code is :
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"isDefault" ascending:NO];
sortedArray = [beneficiariesArray sortedArrayUsingDescriptors:[NSArray arrayWithObject:descriptor]];
NSLog(@"This is Sorted Array %@",sortedArray);
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
cell.textLabel.text = [[sortedArray objectAtIndex:indexPath.row] objectForKey:@"Fullname"];
return cell;
}