jeudi 29 janvier 2015

How to Set Cell label value weather search the text from array in ios


Inside of if true block


lbl.text = celllbltext; ( in this statement how to set value of lbl) its nil ...



if (tableView == self.searchDisplayController.searchResultsTableView)
{
celllbltext=[[searchResults valueForKey:@"name" ] objectAtIndex:indexPath.row];

UILabel *lbl=(UILabel *)[cell viewWithTag:1];

lbl.text = celllbltext;

NSLog(@"lbl1 == %@",lbl.text);

NSLog(@"lbl == %@",[[searchResults valueForKey:@"name" ] objectAtIndex:indexPath.row]);

userImageURL =[NSString stringWithFormat:@"http://ift.tt/1A16fry", [[searchResults valueForKey:@"id" ] objectAtIndex:indexPath.row]];

inviteUserImageURL=[NSString stringWithFormat:@"%@", [[[[searchResults valueForKey:@"picture"]valueForKey:@"data"]valueForKey:@"url"] objectAtIndex:indexPath.row]];

lengthOfID=[[searchResults valueForKey:@"id" ] objectAtIndex:indexPath.row];

NSLog(@"lentid%@",lengthOfID);

lbl.textColor = [UIColor redColor];

} else {

celllbltext=[[frdlist valueForKey:@"name" ] objectAtIndex:indexPath.row];

lbl.text=celllbltext;

NSLog(@"lbl == %@",lbl.text);

userImageURL =[NSString stringWithFormat:@"http://ift.tt/1A16fry", [[frdlist valueForKey:@"id" ] objectAtIndex:indexPath.row]];

inviteUserImageURL=[NSString stringWithFormat:@"%@", [[[[frdlist valueForKey:@"picture"]valueForKey:@"data"]valueForKey:@"url"] objectAtIndex:indexPath.row]];

lengthOfID=[[frdlist valueForKey:@"id" ] objectAtIndex:indexPath.row];

NSLog(@"%@",lengthOfID);
}




Aucun commentaire:

Enregistrer un commentaire