0

I am accessing the OS X address book like so:

if let book = ABAddressBook.sharedAddressBook() { 
    let people = book.people() as [ABPerson]
    for person in people {
        // Now I want to get the person's image to some variable
        ABPersonCopyImageData(person) // compile error
    }
}

Xcode says 'ABPerson' is not convertible to 'ABPerson'.

What's wrong with that?

Thanks in advance, Kim

iquellis
  • 979
  • 1
  • 8
  • 26
  • 1
    I can't tell you why, but it compiles if you replace `as [ABPerson]` by `as [ABPersonRef]`. Looks like a bug to me. – Martin R Mar 31 '15 at 21:54
  • Thanks a lot. Totally weird to me. With [ABPerson] person.valueForProperty(kABFirstNameProperty) works fine. Just for an example. – iquellis Mar 31 '15 at 22:22

0 Answers0