Re: Work with AddressBook without blocking the main thread
Re: Work with AddressBook without blocking the main thread
- Subject: Re: Work with AddressBook without blocking the main thread
- From: Quincey Morris <email@hidden>
- Date: Sun, 26 Apr 2015 03:38:14 +0000
On Apr 25, 2015, at 18:51 , Peter Tomaselli <email@hidden> wrote:
>
> This is for iOS. Isn’t the C API the only option on that platform?
Yes, by the time I got there I didn’t notice that it was OS X only.
I realize I was wrong, too, to call the address book API asynchronous. When you get down to searching for records, it does seem pretty synchronous. Under the circumstances, starting your own captive background thread for doing the bulk search seems like a good idea.
> On Apr 25, 2015, at 20:19 , Roland King <email@hidden> wrote:
>
>> Also, the post served to bring dispatch_get_current_queue() to my attention, which seems quite handy.
>>
>
> Don’t get too excited on that score, it was deprecated 2 OS revisions ago despite there being some legitimate use cases for it. My bug report on that got closed with the “not changing it” response.
There was a discussion a while back, maybe here on this list, on the pitfalls of trying to get the current queue. An Apple engineer explained some of what can go wrong. It’s all terribly subtle, and the only safe answer is “don’t do this”. That was why I punted earlier, and just said you can’t do it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden