Re: Problem using NSTimer in privileged helper tool
Re: Problem using NSTimer in privileged helper tool
- Subject: Re: Problem using NSTimer in privileged helper tool
- From: Quincey Morris <email@hidden>
- Date: Thu, 19 Oct 2017 10:05:24 -0700
On Oct 19, 2017, at 09:04 , Mark Allan <email@hidden> wrote:
>
> Terminating app due to uncaught exception 'NSInvalidArgumentException',
> reason: '*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects
> that adopt NSSecureCoding (object is of class '__NSCFTimer').'
It’s very suspicious that the timer itself would be encoded, since that would
suggest that the timer itself is being passed back across the interface to the
main app. What does the backtrace look like? Ideally there would be something
there that tells you what it’s trying to do at that time.
I don’t know, but I suspect that the block-based NSTimer methods might differ
from the selector-based ones in that they use GCD rather than the run loop. If
you look at the documentation, the old methods say "schedules it on the current
run loop”. The new methods do not.
That suggests the possibility of using dispatch_source_create and
dispatch_source_set_timer directly to create a GCD-based time. It’s not quite
as convenient to code, but not hard to get right.
_______________________________________________
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