+- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
+ if (buttonIndex != [alertView cancelButtonIndex]) {
+ // perform the action
+ [self addContactWithController:viewController];
+ }
+}
+
+#ifdef CONFIRM_ADDING_CONTACT
+#undef CONFIRM_ADDING_CONTACT
+#endif
+- (void)performActionWithController:(UIViewController *)controller
+ shouldConfirm:(bool)confirm {
+#ifdef CONFIRM_ADDING_CONTACT
+ if (confirm) {
+ viewController = controller;
+ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
+ message:NSLocalizedString(@"Add Contact?", @"add contact")
+ delegate:self
+ cancelButtonTitle:NSLocalizedString(@"Cancel", @"cancel button title")
+ otherButtonTitles:NSLocalizedString(@"Add Contact", @"add contact"), nil];
+ [alertView show];
+ [alertView release];
+ } else {
+#endif
+ [self addContactWithController:controller];
+#ifdef CONFIRM_ADDING_CONTACT
+ }
+#endif
+}
+