title: How to display fetch result on table view
body: <p>I want to display the data which is fetched now display on tableview checkout my code</p>
  
  <pre><code>- (void) fetchContacts
  {
  
      CNContactStore *store = [[CNContactStore alloc] init];
      [store requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError * _Nullable error) {
          if (granted == YES) {
              //keys with fetching properties
              NSArray *keys = @[CNContactFamilyNameKey, CNContactGivenNameKey, CNContactPhoneNumbersKey, CNContactImageDataKey];
              NSString *containerId = store.defaultContainerIdentifier;
              NSPredicate *predicate = [CNContact predicateForContactsInContainerWithIdentifier:containerId];
              NSError *error;
              NSArray *cnContacts = [store unifiedContactsMatchingPredicate:predicate keysToFetch:keys error:&amp;error];
              if (error) {
                  NSLog(@"error fetching contacts %@", error);
              } else {
                  NSString *phone;
                  NSString *fullName;
                  NSString *firstName;
                  NSString *lastName;
                  UIImage *profileImage;
                  NSMutableArray *contactNumbersArray;
                  for (CNContact *contact in cnContacts) {
                      // copy data to my custom Contacts class.
                      firstName = contact.givenName;
                      lastName = contact.familyName;
                      if (lastName == nil) {
                          fullName=[NSString stringWithFormat:@"%@",firstName];
                      }else if (firstName == nil){
                          fullName=[NSString stringWithFormat:@"%@",lastName];
                      }
                      else{
                          fullName=[NSString stringWithFormat:@"%@ %@",firstName,lastName];
                      }
                      UIImage *image = [UIImage imageWithData:contact.imageData];
                      if (image != nil) {
                          profileImage = image;
                      }else{
                          profileImage = [UIImage imageNamed:@"person-icon.png"];
                      }
                      for (CNLabeledValue *label in contact.phoneNumbers) {
                          phone = [label.value stringValue];
                          if ([phone length] &gt; 0) {
                              [contactNumbersArray addObject:phone];
                          }
                      }
                      NSDictionary* personDict = [[NSDictionary alloc] initWithObjectsAndKeys: fullName,@"fullName",profileImage,@"userImage",phone,@"PhoneNumbers", nil];
                      [_Contacts  addObject:personDict];
  
                      NSLog(@"%@",phone);
                      NSLog(@"%@",fullName);
                  }
                  dispatch_async(dispatch_get_main_queue(), ^{
                   [self.contacttableview reloadData];
  
  
  
                  });
              }
          }
      }];
  
  }
  
  
  
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
      return [self.Contacts count];
  
  
  
  }
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
      return 1;
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
      UITableViewCell *cell = nil;
      cell = [_contacttableview dequeueReusableCellWithIdentifier:@"cell"];
  
      if(cell == nil){
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
  
  
  
  
  
  
  
          UIImage *image = [UIImage imageNamed:@" person-icon.png"];
          cell.imageView.image = image;
  
      }
  
  
     cell.textLabel.text = [_Contacts objectAtIndex:indexPath.row];
  
      return cell;
  }
  </code></pre>
  
  <p>from this code name and phone number of person is coming on console but not able to dislay on a tableview.</p>
  
  <p>Now i want in the place of text label name of person is come and in the detail label text its phone number is come </p>
  
  <p>and in the cell image its contact picture will be come whatever he stored on his iPhone</p>