Comments (19)
That looks right - I haven't familiarized myself with swift but I literally just wrote the same thing in obj-c yesterday (I use DTTableManager too) with no issues.
Have you checked the contacts array in the debugger before you add it to the memoryStorage?
from apaddressbook.
the list of contacts is right, but after this instruction
self.memoryStorage().addItems(contacts)
it appears duplicate contacts in the tableview
from apaddressbook.
It sounds like your issue is with DTTableViewManager then.
from apaddressbook.
the version of DTTableViewManager is (3.0.1), what version do I have to use?
from apaddressbook.
What exactly is your cell? It sounds like you probably want a customized cell - but it looks like your registering UITableViewCell as your cell class?
For custom cells to work properly in DTTableViewManager you need to either subclass DTTableViewCell or add the DTModelTransfer protocol to your cell and implement the updateWithModel: method. Check out the Examples directory in the github repo
from apaddressbook.
I am having the same issue, duplicated contacts. I suspect this is related to the fact that my contacts on the device are "linked". Those that appear twice are in fact linked to both iCloud and iPhone.
The array in loadContacts:
already returns duplications, so it's not an issue with the way I populate my table view.
I had to use an NSSet like this
NSMutableSet *tmp = [NSMutableSet set];
for (APContact *c in contacts) {
NSString *name = c.compositeName;
if (name == nil) {
name = @"";
}
for (NSString *s in c.phones) {
NSString *res = [s stripPhoneNumber];
ShareContact *c = [[ShareContact alloc] initWithName:name andPhone:res];
[tmp addObject:c];
}
}
and override both isEqual:
and hash
in my custom class to have a correct detection of uniques in the set.
HTH
from apaddressbook.
I was noticing the same issue. Due to linked contacts with iCloud
from apaddressbook.
I believe this issue is a duplicate of #18
from apaddressbook.
Please, provide the way to reproduce duplicated contact. What exactly, I should add in iphone's address book to have duplicated contacts?
from apaddressbook.
@belkevich Go to your contact list and Edit an existing contact. At the bottom you will see an option as + Link Contacts press it and link to another contact. After this operation, these two contacts are linked and merged, and you will see it as 1 contact on your phone book. But when fetching with APAddressBook you will see it as separated.
from apaddressbook.
Thank you very much! I'll check it
from apaddressbook.
So, what is the right behavior? What do you think?
from apaddressbook.
IMHO APAddressBook should returns the same contact list as Contacts App. Any duplicated contact still can be retrieved with APContactFieldLinkedRecordIDs if you want to use it.
Since APContactFieldLinkedRecordIDs only retrieve the linked RecordIDs, a nice to have solution is to add a APContactFieldLinkedRecordContacts flag to pre-populate the linked APContacts into an array.
from apaddressbook.
I'm having the same problem... No solution?
from apaddressbook.
- is all contacts duplicated or just linked contacts?
- does
Example
app have same issue? - please, share the code
from apaddressbook.
the linked contacts are duplicated. i haven't tested the example app, yet...
from apaddressbook.
@lteti77
I've created 2 contacts aaa
and bbb
and linked bbb
into aaa
. So, I see only aaa
in Contacts.app
. But Example.app
shows me both aaa
and bbb
. Is that your problem?
from apaddressbook.
yes, it is. In my code i fixed it by iterating the contatcts and checking if each contacts has some linked contacts. In that case, i remove them from the list.
from apaddressbook.
@lteti77 see this discussion. If you have solution, please let me know.
from apaddressbook.
Related Issues (20)
- Urgent : Message from debugger: Terminated due to memory issue HOT 5
- How to install latest 0.3.1 Version using Pod? HOT 2
- how to display contacts sorted alphabetically HOT 1
- Unable to get the address information HOT 5
- Get Contact Identifier HOT 2
- Can the contacts be persisted in some data store HOT 1
- No visible @interface for 'ContactTableViewCell' declares the selector 'updateWithContact:' HOT 1
- StartObserverChangeswithCallback gets fired multiple time even for a single change in address book HOT 3
- Contact phone number array object prefix with (null) ((null)) - in Xcode 8.2.1 HOT 3
- APAddressBook excessive memory consumption with a large number of contacts HOT 1
- Select the address book HOT 1
- Single contact going duplicate multiple time HOT 2
- Swift 4 update HOT 1
- Is RecordID always unique? HOT 2
- How can I get google id (social type id) HOT 5
- Adding New Contacts Don't Appear In List HOT 2
- 'ABRecordRef' is deprecated: first deprecated in iOS 9.0 HOT 1
- Address not showing. HOT 3
- Add nonGregorianBirthday field to APContact
- APAddressBookExternalChangeRoutine crash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apaddressbook.