I have one API.It is having 4 images and 4 descriptions and 4 names. So My question is when we parse and run the app these things should be displayed at a time.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
DetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (indexPath.section==0)
{
cell.discriptionLabel.text = [arrDiscription objectAtIndex:indexPath.row];
}
else if (indexPath.section==1)
{
cell.displayLabel.text = [arrDisplayName objectAtIndex:indexPath.row];
}
else
{
[cell.imgObj setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"image"]]]];
}
return cell;
}
NSArray *arrActivity1=[dictionray valueForKey:@"products"];
for (NSDictionary *dicObj in arrActivity1)
{
NSString *strDiscription=[dicObj valueForKey:@"description"];
[arrDiscription addObject:strDiscription];
NSLog(@"discriptions are %@",arrDiscription);
NSString *strDisplyName=[dicObj valueForKey:@"display_name"];
[arrDisplayName addObject:strDisplyName];
NSLog(@"displaynames are %@",arrDisplayName);
}
This is my parsing, but I am unable to display the images on the tableview. Please anyone help me.