0

I want to add array object from json data, now I can show my array elements on uitableview header but I want to show with json data. I never worked using json so please help me.

Adding my json and codes below...

MY CODEJSON

Thanks in advance.

Anupam Das
  • 51
  • 1
  • 7
  • `[self.arrHeader addObject:[responseObject objectForKey:@"Data"]];` after check that if array count > 0 than tableview reload – Nirav Kotecha Sep 14 '17 at 06:25
  • 1
    Don't post images. Post text. – vadian Sep 14 '17 at 06:54
  • -(void) retriveData{ @try{ NSString *strURL = [NSString stringWithFormat:LIST_URL]; NSString *subCategory=[[NSUserDefaults standardUserDefaults] objectForKey:@"sub_category_id"]; NSDictionary *params=@{@"sub_cat_id":_strCategory}; IEURLConnection *connection=[IEURLConnection connectionKolapuriWithParams:params andMethod:@"" withURL:strURL delegate:self]; connection.didFailWithErrorHandler=^(NSError *error){ NSLog(@"ERROR %@",error.localizedDescription); }; – Anupam Das Sep 16 '17 at 05:43
  • connection.didFinishLoadingHandler=^(NSURLResponse *response, NSData *responseData){ @try{ NSDictionary *responseObject=[NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:nil]; if([_arrHeader count]>0){ [_arrHeader removeAllObjects]; _arrHeader=[[NSMutableArray alloc]init]; BOOL bResult=[[responseObject objectForKey:@"result"] boolValue]; if (bResult){ NSArray *categoryInfo=[responseObject objectForKey:@"Data"]; for (int i=0; i<[categoryInfo count]; i++){ ShoeTypeObject *shoe=[[ShoeTypeObject alloc]init]; – Anupam Das Sep 16 '17 at 05:48

1 Answers1

0

Do this where Your response is Coming

 //Sucess Response
 self.arrHeader=[ResponseObject valueForKey:@"Data" ];
_tblCatgori.delegate=self;
_tblCatgori.dataSource=self;
[_tblCatgori reloadData];
Vikas Rajput
  • 1,754
  • 1
  • 14
  • 26