Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
JavaScript
{"order_list_1":[
{"name":"@SEVEN (7) OCLOCK BLADE PLATINUM","qty":1,"mrp":1.0},
{"name":"ACT 2 POPCORN BUTTER PEPPER","qty":2,"mrp":2.0},
{"name":"ACT 2 POPCORN CHILLY SURPRISE","qty":3,"mrp":3.0},
{"name":"@MAGGI SOUP HOT N SOUR(1 1)","qty":4,"mrp":4.0},
{"name":"ACT 2 POPCORN GOLDEN SIZZLE","qty":5,"mrp":5.0},
{"name":"AMCHUR AAKHA 1kg","qty":6,"mrp":6.0}]
}

here is my side snippet.
C#
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {

 cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}

NSError *error=nil;
NSDictionary *jsonDict=[NSJSONSerialization JSONObjectWithData:responseData      options:kNilOptions error:&error];
NSArray *statuses=[jsonDict objectForKey:@"order_list_1"];
for (int i=0; i<jsonDict.count; i++) {
    NSDictionary *newDict=[statuses objectAtIndex:i];
NSLog(@"name :%@",[newDict valueForKey:@"name"]);
}
NSDictionary *text=[statuses objectAtIndex:indexPath.row];
cell.textLabel.text=[text objectForKey:@"name"];

return cell;

}
Posted
Updated 17-Jun-12 18:48pm
v8
Comments
Sandeep Mewara 11-Jun-12 5:27am    
What are you trying to show from codebase? Is it not working? Any error? What exactly?
Member 9091669 11-Jun-12 7:59am    
i want to parse 'order_list_1' and show on tableview.
Each row must contains array values like
@SEVEN (7) OCLOCK BLADE PLATINUM 1 1.0
ACT 2 POPCORN BUTTER PEPPER 2 2.0
ACT 2 POPCORN CHILLY SURPRISE 3 3.0
@MAGGI SOUP HOT N SOUR(1 1) 4 4.0

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900