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
5
votes
2 answers

NSArray Leak inside setCompletionBlock

Edit to Question: 21/10/2013 20:10 GMT Added how the method is called below and also the object that is leaking is "allDBObjects" If i remove this and change the dictionary below to "NSMutableDictionary *objectsById" there is no leak. Edit to…
jodm
  • 2,607
  • 3
  • 25
  • 40
5
votes
1 answer

UITableView reloadData is slow

I have a function that connects to the internet and then refreshes the cells in the table. My function is: - (void) updateMethod { NSOperationQueue *queue = [[NSOperationQueue alloc] init]; queue.name = @"Data request queue"; [queue…
AllieCat
  • 3,890
  • 10
  • 31
  • 45
5
votes
2 answers

How to block an NSOperation until an NSOperationQueue finishes?

I have a data loading operation that needs to be run off the main thread to avoid potential blocking issues. To do this, I use an NSOperationQueue and NSOperations. One issue that has come up, however, is that one of the operations exists to spawn…
RonLugge
  • 5,086
  • 5
  • 33
  • 61
5
votes
2 answers

NSOperationQueue waitUntilAllOperationsAreFinished not working while in background

The app I'm working on periodically refreshes it's local data cache from an application server (10+ requests, each of them take a fair amount of time). I'm currently running these requests asynchronously as to not block the UI thread. Since these…
chinabuffet
  • 5,278
  • 9
  • 40
  • 64
5
votes
1 answer

UIImageView+AFNetworking image request queue blocks other network requests from RestKit

I am downloading Data with RestKit by creating RKObjectRequestOperations and adding them to RestKit's queue: RKObjectRequestOperation *operation = [RK objectRequestOperationWithRequest:request success:... failure:...]; [RK…
fschwaiger
  • 173
  • 1
  • 8
5
votes
1 answer

substituting for __weak when not using ARC

I have this line of code: __weak NSBlockOperation *weakOperation = operation; which is triggering this compiler error: __weak attribute cannot be specified on automatic variable. Reason for this is I don't have ARC enabled (not ready to make the…
Ser Pounce
  • 14,196
  • 18
  • 84
  • 169
5
votes
2 answers

Keep running NSOperationQueue when app goes to background

I'm downloading files using NSOperation (s) and adding them NSOperationQueue. NSOperationQueue is getting suspended when app goes in the background. Is there any work around if queue will not suspend in the background and start the next operation?
5
votes
2 answers

NSInvocationOperation callback too soon

I know similar questions have been asked a few times, but I'm struggling to get my head around how this particular problem can be solved. So far, everything I've done has been carried out on the main tread. I now find that I need to perform an…
beev
  • 1,197
  • 2
  • 16
  • 33
5
votes
1 answer

Is it safe to set NetworkActivityIndicatorVisible value in secondary thread?

I wonder if AppDelegate is thread safe? I currently have an operation running networking tasks on the secondary thread, when the task begins, I would like to set NetworkActivityIndicatorVisible to YES, and when the task is done, set it to NO. Do I…
Jason
  • 814
  • 1
  • 6
  • 15
5
votes
3 answers

Do NSOperations and their completionBlocks run concurrently?

I've got a bunch of NSOperations added to a NSOperationQueue. The operation queue has the maxConcurrentOperationCount set to 1, so that the NSOperations run one after the other. Now, in the completionBlock of a NSOperation I want to cancel all…
Tom
  • 260
  • 4
  • 13
5
votes
2 answers

Demystify NSOperation: concurrent vs non-concurrent and async pattern

Yes, I know. There are a lot of questions and answers about the NSOperation world but I'm still having some doubts. Il' try to explain my doubts with a two parts question. They are related each other. In the SO post…
Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
5
votes
2 answers

Any suggestion on following memory leak

I am developing application using NSOPerationqueue. It shows me leak when add OperationBlock in queue as i shown below in image. Please help me to find out leak resolution. If you need more screen shot or detail than please let me know. You can also…
Nitin
  • 7,455
  • 2
  • 32
  • 51
5
votes
1 answer

NSOperation: addsubview in the main thread and slowness

I have implemented the following NSOperation, to draw N custom views - (void)main { for (int i=0; i> //(customView is a UIView with some drawing code in drawrect) …
Abramodj
  • 5,709
  • 9
  • 49
  • 75
4
votes
6 answers

Make NSOperation synchronous

I am working on an app that allows an user to create files and folders on the cloud from iPad. When a file is deleted, the app automatically creates a 'Recycle Bin' folder on the cloud and puts that file in it. I have created NSOperationQueue for…
Musti
  • 41
  • 2
  • 3
4
votes
5 answers

Debugging an intermittently stuck NSOperationQueue

I have an iOS app with a really nasty bug: an operation in my NSOperationQueue will for some reason hang and not finish executing so other additional operations are being queued up but still not executing. This in turn leads to the app not begin…
Jiho Kang
  • 2,482
  • 1
  • 28
  • 38