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

Completion block using GCD

I am developing an app that requires a completion block and a "barrier" functionality. As far as I know, NSOperation API has a completionBlock property and GCD API has the dispatch_barrier_(a)sync function to handle the barrier needs. What should I…
user-123
  • 874
  • 1
  • 13
  • 34
0
votes
2 answers

What code is written behind waitUntilAllOperationsAreFinished (NSOperationQueue)?

The description of this method on https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html#//apple_ref/occ/instm/NSOperationQueue/waitUntilAllOperationsAreFinished says: When called, this…
Stanislav Pankevich
  • 11,044
  • 8
  • 69
  • 129
0
votes
1 answer

check when two NSOperationQueue have finished to call endBackgroundTask for stopping background task mode

in my app i have some NSOperation that update some core data element from a online database, sometime the update require some minute, and when the screen of iPhone lock, the app enter in the background mode, and this update is stopped, so i have to…
Piero
  • 9,173
  • 18
  • 90
  • 160
0
votes
1 answer

NSDictionary passed to NSOperation is null inside the invoked method

I'm using the code below to pass multiple values to NSOperation. I have defined an NSDictionary but I can't access on it (it returns always null) within the method called. Below is my code to invoke the method NSDictionary *params = [[NSDictionary…
0
votes
2 answers

NSUrlConnection asynchronous call for type ahead

I am creating a type ahead in my app that hits a remote rest service. The problem right now is that i am using a NSUrl to connect which is synchronous and because of the amount of looping through the json object it takes some time to parse. That is…
Scoota P
  • 2,622
  • 7
  • 29
  • 45
0
votes
1 answer

Correct usage: NSOperation and NSInvocationOperation

I am studing about NSOperation and I have a doubt about the correct way of implementing it for my situation. In my app I want to perfom a lot of operations in background. Since my app can import data from a desktop software, my database can become…
Rafael
  • 1,655
  • 3
  • 17
  • 25
0
votes
1 answer

ios - making a remote call works on emulator but can not get it to work from live devices

I have a bit of a confusing situation. I have a form after which I create a url and make an asynchronous server call. That data does not need to be secure. Here is what I have: NSString *urlString =…
GeekedOut
  • 16,905
  • 37
  • 107
  • 185
0
votes
1 answer

ASIHTTPRequest in ASINetworkQueue: Cancel request while queue is running

I am using ASIHTTPRequest (I know, I know, it is not being maintained - that doesn't matter; it works and it is what my app is built on) to run a series of HTTP requests through ASINetworkQueue. The problem is that my queue will have many requests…
Jason
  • 14,517
  • 25
  • 92
  • 153
0
votes
3 answers

What would be the equivalent of doing this with NSOperation?

[self performSelector:@selector(stopPulling) withObject:nil afterDelay:0.01]; The code is fine. I just think that using NSOperation and block should be the way to go for the future. I am familiar with NSOperation. I just want to do the same thing…
Anonymous White
  • 2,149
  • 3
  • 20
  • 27
0
votes
1 answer

NSOperation never gets deallocated

I have objects that extends NSOperation. I also have NSOperationQueue. I have a timer that NSLogs operationCount property of that NSOperationQueue every 0.5 seconds. I add new operations to queue and after all of them are finished, queue logs 0 just…
vale4674
  • 4,161
  • 13
  • 47
  • 72
0
votes
2 answers

Loading a UITableViewCell with a NSOperationQueue

Hi guys I have an UITableView that loads precomputed cells from NSMutableArray. I want to use NSOperationQueue or PerformSelectorOnMainThread to update the user interface to enable smooth scrolling but i get an error... this is my code... -…
stefanosn
  • 3,264
  • 10
  • 53
  • 79
0
votes
4 answers

EXC_BAD_ACCESS when adding NSOperation to NSOperationQueue

I've been sitting on this error for hours now. I'm getting an EXC_BAD_ACCESS (code=2) on the line: [self.downloadQueue addOperation:self.downloadOP]; I know it has to be related to memory conflicts, but I just can't find the problem. The class that…
Chris
  • 489
  • 5
  • 15
0
votes
1 answer

cocoa: downloading using ASIHttpRequest and ASINetwork

I'm implementing a download manager in cocoa. The user can add several download requests, and the request manager will show the progress of the requests in a panel. I came into problem about the pause/resume of the request in the queue. For…
scorpiozj
  • 2,687
  • 5
  • 34
  • 60
0
votes
0 answers

Properties not changing on NSOperation

I have an NSOperation running on a background thread, and I want to change a property of it, a float named runSpeed, upon getting a memory warning on the main thread. The next time the background thread hits runSpeed though, it appears to be the…
Andrew
  • 15,935
  • 28
  • 121
  • 203
0
votes
0 answers

NSOperation not continuing after "attributesOfItemAtPath:error " method

I have an NSOperation and am inserting the operation into an operationqueue. I need to set the max concurrent operations to 1. I'll be inserting many such operations from time to time. But I need atmost one operation to be executed at a time. At…
Advaith
  • 1,087
  • 3
  • 12
  • 31