Questions tagged [nsoperationqueue]

On Mac OS X, the NSOperationQueue class regulates the execution of a set of NSOperation objects.

The NSOperationQueue class regulates the execution of a set of NSOperation () objects. After being added to a queue, an operation remains in that queue until it is explicitly canceled or finishes executing its task. Operations within the queue (but not yet executing) are themselves organized according to priority levels and inter-operation object dependencies and are executed accordingly. An application may create multiple operation queues and submit operations to any of them.

References:

1047 questions
3
votes
1 answer

AFHTTPRequestOperation still running even the operation queue is suspended

I'm using the latest AFNetworking V2.0. I have setup series of operations to be run on the AFHTTPRequestOperationManager's operation queue if the reachability is available. I have setup a global AFHTTPRequestOperationManager in the appDelegate and…
3
votes
2 answers

Delaying openURL when app launched via remote push through didFinishLaunchingWithOptions

Here's my app scenario: When user swipes a notification I will launch some other app via URL. So it basically launches some other app when notification arrives. Currently to handle swiping notification scenario, when -…
3
votes
2 answers

Singleton Download Manager?

One of the view controllers in my app allows for downloading files from a server. But a user could navigate to this view controller, hit the "Download" button, and then go back to a previous view controller. If they again navigate to the view…
soleil
  • 12,133
  • 33
  • 112
  • 183
3
votes
2 answers

NSOperation ready but not starting on iOS 7

We created an operation framework to add some functionality not found in the base classes (e.g. tracking success/failure). Parent operations are usually non-concurrent, and may only exist to manage child operations. Child operations which are…
Chuck Doucette
  • 153
  • 2
  • 11
3
votes
1 answer

concurrent NSOperationQueue uploads followed by a single task

I'm trying to perform a 2 step process: Concurrent upload of photos User input then post content , which is very similar to how facebook app works when you "Add Photo" I want to start the upload of photos first in the background using the default…
Nora Olsen
  • 983
  • 2
  • 10
  • 22
3
votes
2 answers

Can I start an NSOperation inside of another NSOperation without a queue?

My application gets the current device location, POSTs this to my server, and returns a dictionary to be displayed in a table view. Currently I am using the CLLocationManager delegate methods and AFJSONRequestOperation (AFNetworking's…
user
  • 3,388
  • 7
  • 33
  • 67
3
votes
1 answer

Fetching Core Data in the background

I have a Navigation View with a Table View, when a row is clicked, the row indexPath is passed to the next view. in the Details view viewDidLoad, i am fetching data from Core Data. i use the fetching from the application delegate [appDelegate…
Adhamox
  • 397
  • 10
  • 19
3
votes
1 answer

NSOperationQueue's addOperation: operation is finished and cannot be enqueued?

Note: This is merely a proof-of-concept. The real background task will be to continuously request 'HTTP Get' of raw data and to display it via main thread; on demand. Scenario: 1) Toggle a background task (loop) on demand. 2) Background task…
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
3
votes
1 answer

Adding an NSOperationQueue to an NSOperation

Is it safe to add an NSOperationQueue to an NSOperation, and then add this operation to another NSOperationQueue? Here is some code to visualize what I am trying to do. NSOperationQueue *mainQueue = [NSOperationQueue alloc] init]; // Here I declare…
tolgamorf
  • 809
  • 6
  • 23
3
votes
1 answer

Setting concurrent operation for NSOperationQueue causes only that number of operation

MyI have an NSOperationQueue with NSOperation objects in it NSOperationQueue *aQueue = [[ NSOperationQueue alloc ] init]; [aQueue setMaxConcurrentOperationCount:3]; for (int index=0; index<=5; index++) { MYOperation *anOperation = [[MYOperation…
Meet
  • 4,904
  • 3
  • 24
  • 39
3
votes
3 answers

block is likely to lead a retain cycle

I've written the following category for NSOperationBlock @implementation NSOperationQueue (Extensions) -(void)addAsynchronousOperationWithBlock:(void (^)(block))operationBlock { dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); …
lucaconlaq
  • 1,511
  • 4
  • 19
  • 36
3
votes
1 answer

Fixing my network activity indicator

I have a problem with my network activity indicator in that sometimes it will continue to be displayed when it should not be. I wrote my own manager for it and swapped it out for one that uses an NSAssert statement like this... -…
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
3
votes
1 answer

order of operations with addOperationWithBlock

I am facing some weird results with addOperationWithBlock. My function looks something like this: -(void) myFunction{ NSLog(@"VISITED"); .. for (NSDictionary *Obj in myObjects) { [operationQueue addOperationWithBlock:^(void){ …
Ted
  • 3,805
  • 14
  • 56
  • 98
3
votes
3 answers

NSOperationQueue concurrent operations with new threads starting inside operations

I have just started using NSOperation/NSOprationQueue, so forgive me for asking this question. :P At the start of my app, I want some set of functions to be performed in a queue, so that when one ends, another starts (I have set…
Nikita P
  • 4,226
  • 5
  • 31
  • 55
3
votes
1 answer

How to cancel NSOperationQueue

Wondering if I'm implementing the below method correctly because isCancelled is not canceling the thread. I have an image that I'm scaling, and when it's done scaling, this method is called to update the image. So when the user lifts their finger…
Ser Pounce
  • 14,196
  • 18
  • 84
  • 169