I want to check result of json is null or not ..I used this code
- (NSString *)likesCount {
if ([facebook valueForKey:@"likes"] == [NSNull null]) {
return @"";
}
else {
return [facebook valueForKey:@"likes"];
}
}
likes = 1
; if it exists and if it is null "like"
is not visible in output.. But if it is not present then it is returning (null)
.. I used above code but it is not working.
I am printing this value of likes in UItableviewcell
UILabel *commentLike = [[UILabel alloc] initWithFrame:CGRectMake(200, 70, 100, 20)];
commentLike.font = [UIFont fontWithName:@"Arial" size:10.0];
NSString *commentLikeString = [NSString stringWithFormat:@"%@ ",[(Facebook *)[tableArray objectAtIndex:indexPath.row]likesCount]];
commentLike.text = [NSString stringWithFormat:@"%@ Person"];
[cell.contentView addSubview:commentLike];
Thanks