开发者

Getting a compiler warning for creating CFArrayRef

开发者 https://www.devze.com 2023-02-03 01:22 出处:网络
I have the following code for some Address Book search: ABAddressBookRef ab = ABAddressBookCreate(); NSString *matchStr = [NSString stringWithFormat:@\"%@ %@\", firstName, lastName];

I have the following code for some Address Book search:

ABAddressBookRef ab = ABAddressBookCreate();
NSString *matchStr = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
CFStringRef namestr = (CFStringRef)matchStr;
CFArrayRef matched = ABAddressBookCopyPeopleWithName(ab, namestr);

The last line gives me the warning: Initialization from incompatible pointer type.

Any ideas why开发者_如何学Go?


This code compiles fine for me, as it seems to do for Steven. You probably have a warning on code close to that part, which you mistakenly attributed to this last line.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号