Contact: to save a contact we must have both name and addr

This commit is contained in:
Gautier Pelloux-Prayer 2016-06-06 10:22:00 +02:00
parent bbff5e2df3
commit 5cedbdfa3a

View file

@ -118,7 +118,9 @@
}
- (BOOL)isValid {
return ((NSString *)_contact.phoneNumbers[0]).length + ((NSString *)_contact.sipAddresses[0]).length > 0;
BOOL hasName = (_contact.firstName.length + _contact.lastName.length > 0)BOOL hasAddr =
((NSString *)_contact.phoneNumbers[0]).length + ((NSString *)_contact.sipAddresses[0]).length > 0;
return hasName && hasAddr;
}
#pragma mark - UITableViewDataSource Functions