Questions tagged [nsinvocationoperation]

The NSInvocationOperation class is a concrete subclass of NSOperation that manages the execution of a single encapsulated task specified as an invocation.

Resource

35 questions
6
votes
1 answer

'NSInvocationOperation' is unavailable in Xcode 6.1

My code suddenly can't be compiled in Xcode 6.1 (I'm sure it's working in Xcode 6 GM and beta version). It shows the error message: 'NSInvocationOperation' is unavailable My code is: let operation = NSInvocationOperation(target:self,…
Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
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
2
votes
1 answer

observeValueForKeyPath is not getting called

I am developing a test app in which I have an NSOperationQueue. I am creating an NSInvocationOperation and observing the "isFinished" property of that operation. Strangely the observeValueForKeyPath is called only sometimes. I am not able to…
user2122350
  • 53
  • 2
  • 7
2
votes
1 answer

Can't seem to call NSInvocationOperation with an NSArray

I am trying to load an image in the background from a url. The code works great if all I pass is the NSUrl. If I try to pass an NSArray with additional variables, it never gets called: This code works great, LoadImage2 is called which in turn nicely…
1
vote
3 answers

loading multiple images from web using NSOperationQueue asynchronously

I have an array or urls which points to images present on the server. Now I want to display the images in a scrollview with 4 images on each row. I am thinking about using NSOperationQueue and NSInvocationOperation to download the images…
pankaj
  • 7,878
  • 16
  • 69
  • 115
1
vote
0 answers

Is an NSInvocationOperation generated operation complete when its selector finishes?

If I create an NSOperation via NSInvocationOperation, does completion of the chosen selector cause the NSOperation to complete and be removed from the operation queue? For example: ... NSDictionary* params = @{KEY_SERVER_ID:serverId,…
Andrew
  • 11,894
  • 12
  • 69
  • 85
1
vote
1 answer

NSOperation subclass vs NSInvocationOperation to replace a GCD operation

I am somewhat new to NSOperation. I have an existing app with a potentially long running task. The task downloads data via a web service. The task could take some time to complete especially in rural areas where connectivity is slow. We need to…
1
vote
1 answer

Get the results returned from an NSInvocationOperation

- (void)viewDidLoad { NSOperationQueue *operationQueue = [[NSOperationQueue alloc]init]; NSInvocationOperation *downloadImageOperation = [[NSInvocationOperation alloc] initWithTarget:[ImageDownloader getInstance] …
pvllnspk
  • 5,667
  • 12
  • 59
  • 97
0
votes
2 answers

Multiples arguments to NSOperation?

I'm using NSOperationQueue in my app and i want to set multiples arguments to my operation how can i do that? NSOperationQueue *queue = [[[NSOperationQueue alloc] init] autorelease]; NSInvocationOperation *operation = [[NSInvocationOperation…
0
votes
2 answers

NSOperationQueue cancel specific operations

The problem is that I manage scrollView with lots of tiles in it. Each visible tile display image loaded from URL or (after first URL load) cached file in background. Invisible tiles recycles (set new frame and redraw). Image load depends on tile…
0
votes
1 answer

UI didn't update because of NSOperationQueue waitUntilFinished YES

I got an issue. The scenario is like this: I got an NSOperationQueue that contain various NSOperationQueue that need to waitUntilDone:YES. And I need to update the UI too as the queue or the operation is running. What is the best way to handle this…
Lunayo
  • 538
  • 7
  • 32
0
votes
1 answer

Arguments retained After finishing NSIvocationOperation?

Edited after I got the answer: - Actually there are no memory leaks. Object added to NSInvocationOperation will be retained and also released as expected. Why is it that after I add an object to NSInvocationOperation it is retained and also after…
0
votes
1 answer

reload UITableView from NSOperation

I have written following code to reload a UITableView from a NSInvocationOperation. However the interface does not update for a long time after calling [tableview reloadData]. Apple documentation says that delegate method won't be called within…
nameless
  • 809
  • 3
  • 9
  • 27
0
votes
1 answer

NSInvocationOperation ignoring maxConcurrentOperationCount

I'm trying to queue up some TWRequest calls using NSInvocationOperation. It seems to add the method calls in the correct order, but the doSomething: methods get called at the same time pretty much, ie run concurrently, rather than one after the…
mootymoots
  • 4,545
  • 9
  • 46
  • 74
0
votes
1 answer

Is it good to subclass NSInvocationOperation to add an iVar to track the kind of Operation?

I wanted to identify each of the NSInvocationOperation to identify what this operation in the isFinished in the KVO notification. So I am planning to not to maintain the NSInvocationOperation as an iVAr in my VC. But when I get KVO notification, I…
RK-
  • 12,099
  • 23
  • 89
  • 155
1
2 3