mardi 24 mars 2015

Retrieving all contact list in iPhone 5+

I'd like to fetch all contact list of a user. I get all permissions from user and all contact numbers but, when i were to print them i see:



<CPRecord: 0x7f9e2258f580 ABPerson>
<CPRecord: 0x7f9e22595a30 ABPerson>
<CPRecord: 0x7f9e225944c0 ABPerson>...


I think, i see the prints above because i am trying to print a NSArray object. I searched a lot about it but, could not find any useful info. Here is my number fetcher func which is used after getting all permissions:



func fetchFromAB(addressBook: ABAddressBookRef){
let allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook).takeRetainedValue() as NSArray

for person: ABRecordRef in allPeople{
println(person)
}
}



Aucun commentaire:

Enregistrer un commentaire