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

How to stop a task initiated using NSOperationQueue?

I have created a process using NSOperationQueue in the below way: queue = [[NSOperationQueue alloc]init]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self …
Satish
  • 133
  • 11
0
votes
2 answers

NSOperaionQueue and UIAlertView

The problem is that if I create and display two alert - the second will override the first, and after it closed displayed first. So not pretty. I'm trying to create a queue alerts with NSOperationQueue. That you could add a few alerts and they show…
glebus
  • 197
  • 1
  • 1
  • 11
0
votes
1 answer

NSOperation: update UI after finishing task

I've built up a test project with NSOperation and NSOperationQueue. There is only one textbox: @property (weak) IBOutlet NSTextField *textbox; In the background this is performed: - (void)main { NSURL *url = [NSURL…
0
votes
2 answers

How to use NSURLConnection inside a dispatch_queue or NSThread or NSOperationQueue?

I have tried using NSURLConnection inside NSThread and dispatch_queue. The implemented NSURLConnectionDelegate methods are not called. But when I used NSOperation inside of NSThread and NSOperationQueue, the methods are called.
0
votes
2 answers

Execute method on main thread from inside some other method executing on background thread?

This is what my code looks like now and I want to call these methods in a serial manner: -(void) methodOnBackThread // this method will run on a background thread { [runner runThisMethod]; // and this will run on the same background thread as…
Norton Commander
  • 653
  • 1
  • 10
  • 21
0
votes
4 answers

Running parallel tasks in background

I am using NSOperationQueue to run the task. I am using background processing in my application. But while adding tasks in NSOperationQueue, I found that tasks will be added in a queue format. Does NSOperationQueue performs parallel task or…
0
votes
1 answer

I need informations about the thread in a NSOperation in concurrency mode

I have a NSURLConnection asynchrone in NSOperation in concurrency mode. I know that by default, the NSOperationQueue creates the thread for the NSOperation (non-concurrent). But, in concurrency, does it means that i have one thread in another…
0
votes
2 answers

Techniques for tracking threads in Grand Central?

I suspect my app is creating lots of threads using dispatch_async() calls. I've seen crash reports with north of 50 and 80 threads. It's a large code base I didn't write and haven't fully dissected. What I would like to do is get a profile of our…
0
votes
2 answers

NSOperationQueue operations filteredArrayUsingPredicate error

I have class MyOperation : NSOperation with @property (nonatomic, retain) NSString *oID; And sometimes I need to cancel operation with specific oID. I'm trying to do this: NSArray *operations = operationQueue.operations; NSPredicate *predicate =…
Rost K.
  • 262
  • 2
  • 14
0
votes
1 answer

blocks threaded freeze when the UIView moves

All is title :) I have this method : [[NetworkManager sharedInstance] getContentFromUrl:url withId:@"json" onResultBlock:^(NSData *data, NSString *identifier) { NSLog(@"done") } onFailureBlock:^(NSError *error, NSString *identifier)…
0
votes
2 answers

How do asynchronous NSURL requests fit with grand central dispatch / Operation queues ?

Can someone explain the relationship between asynchronous NSURL requests and GCD and NSOperationQueues? I am not sure when to use each. Right now, I have been "getting away" with asynchronous NSURL requests when I need to fetch/upload data to the…
0
votes
1 answer

Sibling NSManagedObjectContexts when using NSOperations

I'm running into some trouble working with CoreData in a multithreaded app using NSOperations. I am using nested ManagedObjectContexts through MagicalRecord (2.0.3) as follows: Root Context (saves to disk) | Main Thread Context (for populating the…
0
votes
0 answers

addOperationWithBlock:, how to add operations to a queue within a while loop

I have a long running task that reads a file from the documents directory, parses it, deletes the file, then reads the next file from the doc directory, parses, deletes. I'm trying to put this code in the background but having trouble. I got so…
Crystal
  • 28,460
  • 62
  • 219
  • 393
0
votes
2 answers

How to get the index when adding something to NSOperationQueue?

I need the indexes of my operations added to NSOperationQueue, And hope it works like this: @interface MyOperation : NSObject { NSInteger index; /* Do Something */ } Following will set the index member of myOperation as the…
Maadiah
  • 431
  • 6
  • 20
0
votes
1 answer

iOS queuing the upload tasks

In iOS I need to call same method number of time, but the app has to wait until the method completed it's first task. (I can not use bool value to check whether the function is running or not). How can I queue the request or wait until it's previous…
Chinthaka
  • 966
  • 1
  • 13
  • 42