Re: Executing a very low-priority operation in iOS
Re: Executing a very low-priority operation in iOS
- Subject: Re: Executing a very low-priority operation in iOS
- From: Rick Mann <email@hidden>
- Date: Wed, 25 Apr 2012 17:58:09 -0700
On Apr 25, 2012, at 17:50 , Julius Oklamcak wrote:
>> Normally I'd set up a timer to fire in a minute, set up an
> NSBlockOperation,
>> and let it go. When it finishes, I'd repeat the process. But I don't see
> any
>> way to adjust the priority of an NSOperationQueue.
>
> NSBlockOperation inherits from NSOperation so you should be able to
> -setQueuePriority: and/or -setThreadPriority: on it.
-setQueuePriority:, I think, only adjusts the priority of that operation relative to other operations on that queue.
But -setThreadPriority: is obvious; I didn't even see it there, despite staring right at it.
Thanks!
--
Rick
>
> You could also use something like the following to run the block:
>
> dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND,
> 0),
> ^{
> // ...
> });
>
_______________________________________________
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