title: Can not Edit Address Book Record from iphone app
body: <p>I want to edit record from address book in my iphone app. But I can not edit any record. Here is my code</p>
  
  <pre><code> // In my First View Controller
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
     DetailViewController *detailViewController=[[DetailViewController alloc] initWithRecordObject:record];
  
   [self.navigationController pushViewController:detailViewController animated:YES];
      [detailViewController release];
  }
  
  //------------------------------------
  
  #import &lt;UIKit/UIKit.h&gt;
  #import &lt;AddressBook/AddressBook.h&gt;
  #import &lt;AddressBookUI/AddressBookUI.h&gt;
  #import "User.h"
  
  @interface DetailViewController : UIViewController &lt;UITableViewDelegate,UITableViewDataSource,UIActionSheetDelegate,ABPersonViewControllerDelegate&gt; {
  
      ABRecordRef record;
      // Some other ivars
  }
  - (id)initWithRecordObject:(ABRecordRef)myrecord;
  
  //------------------------------------
  
  @implementation DetailViewController
  
  - (id)initWithRecordObject:(ABRecordRef)myrecord
  {
      self = [super initWithNibName:@"DetailViewController" bundle:nil];
      if (self) {
          record = myrecord;
      }
      return self;
  }
  
  #pragma mark - Edit Record Method
  
  -(void)btnEditContactTapped:(id)sender {
  
      // Fetch the address book 
      ABAddressBookRef addressBook = ABAddressBookCreate();
  
      ABRecordID recID = ABRecordGetRecordID(record);
  
      ABRecordRef record1 = ABAddressBookGetPersonWithRecordID(addressBook,recID);
  
      ABPersonViewController *personViewController = [[ABPersonViewController alloc]init];
  
      // set delegate
      personViewController.personViewDelegate = self;
  
      // Allow editing info
      personViewController.allowsEditing = YES;
  
      // Display contact info of selected person
      personViewController.displayedPerson = record1;
  
      personViewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(returnFromPersonView)] ;
  
      APP_DELGATE.isContactEdited = YES;
  
      [self.navigationController pushViewController:personViewController animated:YES];
  
      [personViewController release];
  }
  
  -(void)returnFromPersonView {
      NSLog(@"In %s",__PRETTY_FUNCTION__);
      [self.navigationController popViewControllerAnimated:YES];
  
  }
  
  #pragma mark - ABPersonViewControllerDelegate Method
  
  - (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue {
  
      //[self dismissModalViewControllerAnimated:YES];
      return NO;
  }
  </code></pre>
  
  <p>When I push personViewController , I can't see anything regarding record. Here is a screenshot</p>
  
  <p><img src="https://i.stack.imgur.com/74ubS.png" alt="enter image description here"></p>
  
  <p>Any kind of help is highly appreciated.Thanks</p>