Preventing from adding existing contact with notification
<p>Currently i am working with the addressbook framework, so basically i have created an addressbook where you can add directly to contacts from my current app. Here's the code :</p>

<pre><code>- (void)addToContact {

    //  GET ADDRESS BOOK
    ABAddressBookRef addressBook = ABAddressBookCreate();
    ABRecordRef person = ABPersonCreate();

    // ADD NAME
    ABRecordSetValue(person, kABPersonFirstNameProperty, detail.title, nil);

    // ADD PHONE NUMBER
    ABMutableMultiValueRef multiPhone = ABMultiValueCreateMutable(kABMultiStringPropertyType);
    ABMultiValueAddValueAndLabel(multiPhone, detail.tel_no, kABPersonPhoneMainLabel, NULL);
    ABRecordSetValue(person, kABPersonPhoneProperty, multiPhone,nil);
    CFRelease(multiPhone);

    // ADD ADDRESS
    ABMutableMultiValueRef multiAddress = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);

    NSMutableDictionary *addressDictionary = [[NSMutableDictionary alloc] init];
    [addressDictionary setObject:detail.address forKey:(NSString *) kABPersonAddressStreetKey];
    ABMultiValueAddValueAndLabel(multiAddress, addressDictionary, kABWorkLabel, NULL);
    ABRecordSetValue(person, kABPersonAddressProperty, multiAddress,nil);
    CFRelease(multiAddress);
    [addressDictionary release];

    // ADD URL
    ABMutableMultiValueRef url = ABMultiValueCreateMutable(kABMultiStringPropertyType);
    ABMultiValueAddValueAndLabel(url, detail.url, kABPersonHomePageLabel, NULL);
    ABRecordSetValue(person, kABPersonURLProperty, url, nil);
    CFRelease(url); 

    ABAddressBookAddRecord(addressBook, person, nil);
    ABAddressBookSave(addressBook, nil);    

    CFRelease(person);

    UIAlertView *viewAlert = [[UIAlertView alloc] initWithTitle:@""
                                                        message:@"Added to contacts!"
                                                       delegate:nil cancelButtonTitle:nil
                                              otherButtonTitles:@"Okay", nil];
    [viewAlert show];
    [viewAlert release];


}
</code></pre>

<p>So right now, i am trying to find a way, how when you want to add the same contact, it would not add it but instead display a notification that the contact is already exist. Can anyone assists me on this?</p>
