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

How can i set the priority in NSOperationQueue to execute the next operation until the previous is finished?

How can i set the priority in NSOperationQueue to not execute the next operation until the previous operation is finished? NSOperationQueue *operationQueue = [[NSOperationQueue alloc] init]; [operationQueue setMaxConcurrentOperationCount:1]; …
Ziad.T
  • 119
  • 4
0
votes
1 answer

ARC not freeing original asset after CGCreateWithImageInRect?

High level summary: I would like to replace the rather low resolution ALAsset Group images [group posterImage] with a higher quality version so that they can be shown larger on the screen. Normally I would load them as needed by the interface, but…
MobileVet
  • 2,958
  • 2
  • 26
  • 42
0
votes
1 answer

AFNetworking - Why does the asynchronous XML operation not fire and the loop runs infinitely?

This probably has something to do with my understanding of blocks and probably how/when the NSOperationQueue fires it's operations but I'll ask anyway: I have a basic fetch request method: - (void)fetchActiveUser:(NSString*)username…
-1
votes
1 answer

Calling -[NSRunLoop runMode:beforeDate:] on main thread causes queued NSOperations to run on main thread

I ran into an issue today where my app was failing to start in time. It turns out some third-party code I was using was trying to get the user agent string using the trick below: -(NSString*)userAgentString { webView = [[UIWebView alloc] init]; …
Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
-1
votes
2 answers

NSURLConnection. I need a help saving data received

I'm starting a NSURLConnection and I need to save data received from internet. In the - (void)connectionDidFinishLoading:(NSURLConnection *)connection I need to save data with different name using the original url as name of the data... How Can get…
paul_1991
  • 245
  • 4
  • 13
-1
votes
3 answers

NSOperationQueue and threads problem

Well I have a serious problem. I have a class that manages connections with NSOperationQueue and delegate methods for that class that are actually NSURLConnection delegate methods. Sometimes, I have to pop the viewController that has the answer of…
Herz Rod
  • 831
  • 8
  • 21
-1
votes
1 answer

Why does my BlockOperation continue after I add it to an OperationQueue?

Apple documentation says that Operations run synchronously. Why then does the code continue to run after an operation is added to a queue? Here is my code: let op = BlockOperation(block: { print("Done") }) let qu =…
daniel
  • 1,446
  • 3
  • 29
  • 65
-1
votes
1 answer

URLSessionTaskDelegate never called in Command Line tool

I'm trying to write my first Swift command line tool. The tool creates a network request and I want to print the progress of the request using URLSessionTaskDelegate. The basic URL request code is here: EDIT: updating more complete example class…
Tyler
  • 889
  • 1
  • 11
  • 17
-1
votes
1 answer

Application is crashing while using DispatchQueue.main.sync

I am doing experiments with Grand Central Dispatch and have come across a crash on synchronous task. func viewDidLoad() { super.viewDidLoad() self.testHello() print("Task2") } func testHello() { DispatchQueue.main.sync { …
Aman.Samghani
  • 2,151
  • 3
  • 12
  • 27
-1
votes
1 answer

Change priority of operations in NSOperationQueue iOS

i am adding the operations to the NSOperationQueue in asynchronously. I have a requirement like I need to change the priority of the operations like I have A,B,C operations are added to the queue and I need to execute the C operation at first. If I…
-1
votes
2 answers

Is the following a safe use of dispatch_set_target_queue()?

What I want to do is create an indirect queue targeting the main queue. dispatch_queue_t myQueue = dispatch_queue_create("com.mydomain.my-main-queue", NULL); dispatch_set_target_queue(myQueue, dispatch_get_main_queue()); My ultimate goal is to use…
-1
votes
1 answer

object of NSOperation doesn't removed from NSOperationQueue after executing

In my subclass of NSOperation I set 4 flags, and when an operation finishes its execution it is not removed to NSOperation queue, where it was added at the beginning, this thing cause a lot of issues in my app. I suppose that the way I set these…
Melany
  • 466
  • 7
  • 20
-1
votes
1 answer

iOS package AFNetworking With queue

I want to package AFNetworking in order to that urls can request one by one , but o don't know how to package it. for example , there are three url request want to send to server , I hope that send one url request by AFNetworking first , and when…
kai
  • 21
  • 2
-1
votes
2 answers

NSURLSession takes too much time

I'm using NSURLSession to post a request. Although I'm setting queue to main queue still it takes too much time to respond NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *session =…
Misha
  • 685
  • 8
  • 20
-1
votes
1 answer

Objective-C - What Types of Problems Can Occur When Updating UI Off Main Thread

I had a job interview this morning and was presented with the following code and asked to find the problem: @interface TTWaitController : UIViewController @property (strong, nonatomic) UILabel *alert; @end @implementation TTWaitController -…
1 2 3
69
70