Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ABRecordSetValue in IOS 5 Xcode 4.2

I am a newbie and I have a question with ABRecordSetValue in Xcode 4.2. I have this code:

        ABRecordSetValue(aContact, kABPersonLastNameProperty, lastName, &anError);    

But, I keep on receiving this error message:

Implicit conversion of an Objective-C pointer to 'CFTypeRef' (aka 'const void *') is disallowed with ARC

I have the 'lastName' field as a NSString. What is wrong with my code?

Thank you in advance.

like image 322
Todd Pleeter Avatar asked Jan 22 '26 07:01

Todd Pleeter


1 Answers

As third parameter expects CFTypeRef, we can do below casting.

Try this:

ABRecordSetValue(aContact, kABPersonLastNameProperty, (CFStringRef)lastName, &anError);
like image 167
Saran Avatar answered Jan 26 '26 06:01

Saran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!