title: iOS How to reload tableview reload data of parsing array?
body: <p>I am newbie in iOS and i have an issue i parsed an array and show in table which having three sections and every each section i added new row to add up its all children in hierarchy but due to table reload issue its indexing change and show wrong results. here is my code below</p>
  
  <pre><code>+ (void)getTypesWith:(void (^)(NSArray *, NSError *))completionHandler
  {
      [ZNetworkManager postDataForBackGround:nil atURL:[ZMappingManager getRequestURLToGetPropertiesTypes] completionHandler:^(NSArray *array, NSError *error)
       {
           NSMutableArray *typesDictionariesArray =[NSMutableArray array];
           NSMutableDictionary* details = [NSMutableDictionary dictionary];
           if (!error)
           {
               NSDictionary *fetchedDictionary = (NSDictionary *) array;
               if([fetchedDictionary isKindOfClass:[NSDictionary class]] == NO)
               {
                   [details setValue:@"Fetched dictionary is null" forKey:@"desription"];
                   completionHandler(nil ,[NSError errorWithDomain:@"MyDomain" code:1 userInfo:details]);
               }
               else
               {
                   if([[[fetchedDictionary objectForKey:@"meta"] objectForKey:@"status"] isEqualToString:@"200"]){
                       NSDictionary *data = [fetchedDictionary objectForKey:@"response"];
                       if([data isKindOfClass:[NSDictionary class]] == NO)
                       {
                           [details setValue:@"Fetched dictionary is null" forKey:@"desription"];
                           completionHandler(nil ,[NSError errorWithDomain:@"MyDomain" code:1 userInfo:details]);
                       }
                       else
                       {
                           NSArray *allTypes = [data objectForKey:@"type"];
  
                           if([allTypes count] == 0)
                           {
                               [details setValue:@"Fetched dictionary is null" forKey:@"desription"];
                               completionHandler(nil ,[NSError errorWithDomain:@"MyDomain" code:1 userInfo:details]);
                           }
                           else
                           {
                               NSMutableArray *searchTypes = [[NSMutableArray alloc] init];
  
                               for (int i=0; i&lt;[allTypes count]; i++)
                                   //                             for (NSDictionary *typeDic in allTypes)
                               {
                                   NSDictionary *typeDic = [allTypes objectAtIndex:i];
                                   [typesDictionariesArray addObject:typeDic];
                                   ZZameenType *newType = [[ZZameenType alloc] init];
                                   [newType loadFromDictionary:typeDic];
                                   [searchTypes addObject:newType];
                                   NSArray *arrayforChild = [typeDic objectForKey:@"childs"];
  
                                   for (int j=0; j&lt;[arrayforChild count]; j++)
                                       //                                 for(NSDictionary *typeChild in arrayforChild)
                                   {
                                       NSDictionary *typeChild = [arrayforChild objectAtIndex:j];
                                       ZZameenType *newChild;
  
                                       [typesDictionariesArray addObject:typeChild];
                                       newChild = [[ZZameenType alloc] init];
                                       [newChild loadFromDictionary:typeChild];
                                       [searchTypes addObject:newChild];
  
                                       if(j == 0)
                                       {
                                           NSMutableDictionary *dict = [NSMutableDictionary dictionary];
                                           NSString *combineString = [NSString stringWithFormat:@"All %@",[typeDic objectForKey:@"title_alt2"]];
                                           [dict setObject:combineString forKey:@"title"];
                                           [dict setObject:combineString forKey:@"title_alt2"];
                                           [dict setObject:combineString forKey:@"title_alt1"];
                                           [dict setObject:[typeDic objectForKey:@"type_id"] forKey:@"parent_id"];
                                           [dict setObject:[typeDic objectForKey:@"child_list"] forKey:@"type_id"];
  
                                           [typesDictionariesArray insertObject:dict atIndex:[typesDictionariesArray count]-1];
  
                                           newChild = [[ZZameenType alloc] init];
                                           [newChild loadFromDictionary:dict];
                                           [searchTypes insertObject:newChild atIndex:[searchTypes count]-1];
                                       }
                                   }
                                   newType = nil;
                               }
  
                               NSSortDescriptor *typeID_sort = [NSSortDescriptor sortDescriptorWithKey:@"type_id" ascending:YES];
                               [searchTypes sortUsingDescriptors:[NSArray arrayWithObjects:typeID_sort,nil]];
                               [ZGlobals saveSearchTypes:typesDictionariesArray];
                               completionHandler(searchTypes ,nil);
                               searchTypes = nil;
                               details = nil;
  
  
                           }
                       }
  
  
                   }else{
  
                   }
               }
           }
       }];
  
  }
  </code></pre>
  
  <p><em>cellForRowAtIndexPath</em></p>
  
  <pre><code>if(selectionC == nil) { 
      selectionC=[[[NSBundle mainBundle] loadNibNamed:@"SelectionCell" owner:self options:nil] objectAtIndex:0]; 
  } 
  KLog(@"view frame is %@",NSStringFromCGRect(self.frame)); 
  KLog(@"table frame is %@",NSStringFromCGRect(tableView.frame)); 
  NSArray *values =[[ZGlobals getPropertTypeSectionsValues] objectAtIndex:indexPath.section]; 
  ZZameenType *type =[values objectAtIndex:indexPath.row];
  selectionC.selectionTitle.text = type.title;
  selectionC.selectionTitle.textColor = [ZTheme cellValuesColorIPAD];
  </code></pre>