Vishnu
Vishnu

Reputation: 2243

Displaying JSON Object in UITableView Cell - App Crashes

I'm loading a json file from my server which have several fields like id,category,value,price.i tried SBJSON library files. If i'm trying to display single content in a cell i'm using the following code

cell.textLabel.text=[[mutarray objectAtIndex:indexPath.row] valueForKey: @"id"];

but if i need to display all the field like id,category,value in each cell.i'm not aware of that.Kindly guide me..

here mutarray is my NSMutableArray which contains all elements of my json file..

Upvotes: 0

Views: 127

Answers (2)

Vishnu
Vishnu

Reputation: 2243

i done that using following code

cell.textlabel.text=[[NSString stringWithFormat:@"%@",[[mutarray objectAtIndex:indexPath.row] valueForKey: @"id"]];

The issue is i forgot to convert the JSON Object into NSSTring

Upvotes: 1

parilogic
parilogic

Reputation: 1189

You will need to put custom cells. Please check the link below and tell me if any doubts.

Putting Custom Cells in Table View

Upvotes: 2

Related Questions