I have a class that subclasses ABNewPersonViewController . As I understand it, when the "Finish" button on the navigation bar is clicked, the delegate method
- (void)newPersonViewController:(ABNewPersonViewController *)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person
called out. But before entering the delegate method, the changes will be saved in the address book.
I need it as soon as the save button is pressed. I need to load a UIView with two buttons asking the user,
- does he want change and
- should he interrupt the changes made,
But this must be done before the changes are reflected in the address book. And only when you click the first button in the UIView , the changes must be saved in the address book.
When the second button is clicked, the view should disappear, and I should return to the view controller class, from where the UIView loaded.
My question is how to upload the image to the "Save" button before the changes are reflected in the address book
I created a custom save button
UIBarButtonItem *okBtn = self.navigationItem.rightBarButtonItem; UIBarButtonItem *saveBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:okBtn.target action:okBtn.action]; self.navigationItem.rightBarButtonItem =saveBtn; [saveBtn release];
In the save button action, the control moves to the delegate method
- (void)newPersonViewController:(ABNewPersonViewController *)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person` .
I want the control to go to my custom method, where I can load my UIView before the changes are saved in the address book.
Edit: When I load ABNewPersonViewController
ABPersonViewController *displayVcardViewController = (ABPersonViewController*)[self.navigationController visibleViewController]; ABRecordRef person = displayVcardViewController.displayedPerson; EditAddressNewPersonDetailViewController *newVCardViewController = [[EditAddressNewPersonDetailViewController alloc] init]; newVCardViewController.displayedPerson = person; newVCardViewController.newPersonViewDelegate = self; newVCardViewController.isEditingMode = YES; [self.navigationController setToolbarHidden:YES]; [self.navigationController pushViewController:newVCardViewController animated:YES]; [newVCardViewController release];
Is this strong link already or not. Where should I include a strong link.
On
- (void)actionSave:(UIBarButtonItem *)sender { if([[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil]) { [self.myView setFrame:CGRectMake(0, 0, 320, 480)]; [[UIApplication sharedApplication].keyWindow addSubview:self.myView]; UIActionSheet * action = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle:@"Do" destructiveButtonTitle:@"Cancel" otherButtonTitles: nil]; action.tag = 101; [action showInView:self.view]; [action release]; } }
I am loading a UIView with a UIAlertView above it.