Re: CALayer -drawInContext and GCD
Re: CALayer -drawInContext and GCD
- Subject: Re: CALayer -drawInContext and GCD
- From: vincent habchi <email@hidden>
- Date: Thu, 2 Sep 2010 20:29:50 +0200
David, Chris,
I promise I did not plan to start an Apple internal quarrel! ;)
>>> dispatch_async(queue, ^{
>>> [layer display];
>>> [CATransaction flush];
>>> }
>>
>> There is (almost) never any reason for anyone to be calling +[CATransaction flush] directly. You'll cause all sorts of unexpected things to happen w.r.t. extant CATransactions. You should let +flush be called at the end of the run loop on its own.
>
> The work is occurring on a GCD queue, which has no runloop running, as such it won't be called on its own and there are no other extant transactions to be affected. Assuming 'queue' isn't the main thread queue that is.
You mean I shall use your dispatch_async invocation instead of calling [layer setNeedsDisplay]? I was thinking of calling dispatch_async () inside -drawInContext, but, if I understand your example correctly, this is wrong.
Thanks for taking the time to answer me,
Vincent_______________________________________________
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