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
2
votes
1 answer

NSOperation for loading image to Cell - crashing

Im using NSOperation to download each cell's image so i don't overload the user with heavy image loading. This works 99% of the times but from time to time i get an nil inside my operation block and the app crash. This is the code: …
Gusfat
  • 111
  • 11
2
votes
0 answers

Dispatch Group inside NSOperation - Still allowing multiple operations despite maxConcurrentOperationCount = 1

I am aiming for a serial download queue within NSOperation subclass using dispatch groups to manage async tasks. I have maxConcurrentOperationCount set to 1 i have defined my queue var GlobalDownloadQueue: DispatchQueue { return…
2
votes
1 answer

NSOperation maxConcurrentOperationCount = 1 still allowing multiple operations of subclass

I have subclassed NSOperation (what is now known as Operation) to perform some async queries in the background. I would like these to be executed one at a time. To this end i have set maxConcurrentOperationCount to 1 however it is still allowing…
DuckMan
  • 133
  • 1
  • 12
2
votes
2 answers

Should I use operation queue for this complete scenario?

I need to perform a scenario with the following steps: To make a network call with some search parameters provided by the user Then, to parse its JSON response and create model entities Then, for each entity created and if it has an associated…
2
votes
1 answer

How to make simultaneous https requests in Swift 3

I'm having problems to execute a https requests, if the request don't have any error i never get the message, this is a command line tool application and i have a plist to allow http requests, i always see the completion block. typealias escHandler…
eduardo
  • 123
  • 1
  • 11
2
votes
1 answer

AWS SDK - Implementing a network queue for CloudFront downloads

I'm currently working on an iOS project that utilises the AWS SDK to download large media files to the device. I am using CloudFront to distribute the content and the downloads are working well, however I am having problems implementing a network…
2
votes
0 answers

Waiting for operation to complete in Swift 3

I'm trying to use the new DispatchGroup mechanism with an OperationQueue so that my unit test will wait for completion. After watching the WWDC videos I've only seen how to use groups with async calls from regular dispatches. How do I get the same…
Mercutio
  • 1,152
  • 1
  • 14
  • 33
2
votes
1 answer

NSOperation(s) leaks only on iOS 3 device

I have some NSOperations subclasses that handle CoreData imports. I believe i've ticked most of the non-main thread issues I create my own autorelease pool in the main method I create a NSManagedObjectContext for each operation These operations…
2
votes
2 answers

Synchronous fetching data NSOperationQueue or NSURLSession

In my app , we have to make 3 server calls when we click on the login button. 1) will make a server call to get an OAuth token for user credentials 2) with the token from (1) we will get user privileges 3) with the token from (1) and with the valid…
Sharanya K M
  • 1,805
  • 4
  • 23
  • 44
2
votes
2 answers

What will happen if we give UIlabel to background thread in GCD or NSOperationQueue

I was asked this question in an interview. I want to know what will be the case if we give UILabel to background thread.
2
votes
0 answers

How to queue, pause and resume download Alamofire.Request?

I'm using Alamofire as my HTTP framework, I'm currently using NSOperation and NSOperationQueue to limit my concurrent request to 3. This works fine without modifying my request queue. However, I'm in a situation when I need to pause a current…
chlkdst
  • 175
  • 3
  • 13
2
votes
0 answers

Naming dispatch_queue's in NSOperationQueue

In my app I use NSOperations and NSOperationQueue a lot. When I use regular dispatch_queue_t I get to name them at instantiation time, so they show up in Xcode's Debug Navigator with that name while debugging. Is there any way I can ask…
niklassaers
  • 8,480
  • 20
  • 99
  • 146
2
votes
1 answer

Using NSOperations to execute operations in serial, maxConcurrentOperationCount is not working

I am not sure where I am going wrong. I have to download a file back to back, i.e., when ever I trigger the new download. Always second download should happen after first download. I have to use NSOperationQueues to achieve this. I am using …
Sravan
  • 1,891
  • 4
  • 23
  • 28
2
votes
2 answers

Make NSOperations Mutually exclusive

Refer this video from WWDC https://developer.apple.com/videos/play/wwdc2015/226/ The speaker shows that we can add dependency between two NSopeation instances of same type. Example an NSoperation that displays an alert. By achieving this we can make…
Aditya Gaonkar
  • 660
  • 6
  • 13
2
votes
1 answer

At which moment exactly is completionBlock executed on NSOperation?

I am just wondering at what exact moment a completionBlock is executed on a NSOperation owned by a NSOperationQueue. On my newest project, a client for Amazon S3 (https://github.com/StudioIstanbul/SIAFAWSClient), I use a NSOperation with a…