[CNContact] CNContact fix Contact detail edition add only one email/phone

This commit is contained in:
Brieuc Viel 2017-11-10 14:49:01 +01:00
parent 4e7b509954
commit c910192da5

View file

@ -75,12 +75,16 @@
- (void)addEntry:(UITableView *)tableview section:(NSInteger)section animated:(BOOL)animated value:(NSString *)value {
bool added = FALSE;
if (section == ContactSections_Number) {
if ([_contact.phones count] ==
[_contact.person.phoneNumbers count])
added = [_contact addPhoneNumber:value];
} else if (section == ContactSections_Sip) {
if ([_contact.sipAddresses count] ==
[_contact.person.instantMessageAddresses count])
added = [_contact addSipAddress:value];
} else if (section == ContactSections_Email) {
if ([_contact.emails count] ==
[_contact.person.emailAddresses count])
added = [_contact addEmail:value];
}
if (added) {