An NSInvocation object contains all the elements of an Objective-C message: a target, a selector, arguments, and the return value. Each of these elements can be set directly, and the return value is set automatically when the NSInvocation object is dispatched.
Questions tagged [nsinvocation]
154 questions
0
votes
2 answers
NSInvocation returning nil
Does anyone know how can I set the argument of NSInvocation to be nil ?
I am trying to use OCMock and I would like this expectation to return nil. The problem is that I need to do something else when the method is called, as you can see in the…

Nicolas Yuste
- 673
- 9
- 15
0
votes
1 answer
NSInvocation & NSTimer - Method gets called twice
I've created a small app, which has a UISegmentedControl with to segments and a UITableView. When the selected segment changes, the data in the TableView (which is download from a server) should change. Therefore I have a method
-…

Codey
- 1,131
- 2
- 15
- 34
0
votes
1 answer
Uploading files in background mode
I have two views: myFristView and mySecondView, in myFristView I have a code which can read the fields in my database and then send to a PHP server, this code NSInvocationOperation using this class to send the files in background mode.
The process…

user3781174
- 245
- 5
- 16
0
votes
2 answers
How to store an init call in an NSInvocation?
I'm trying to set up an app that works with UIPageViewController. I technically could instantiate all the view at once and put them in an array, but that would be expensive, and it seems better to initialize the views as needed. I read that an…

PopKernel
- 4,110
- 5
- 29
- 51
0
votes
1 answer
Get object array argument from NSInvocation with ARC
I have a method with the following signature:
- (void)takeIntsAndRecieveIntsAsync:(MyInt *__strong [])
completion:(void (^)(MyInt * __strong response[]))success;
I had a couple of questions:
1. How do I retrieve the…

pshah
- 2,052
- 1
- 21
- 40
0
votes
1 answer
NSProxy and forwardInvocation: invoke called within a block causes nil return value
I am using a NSProxy subclass and forwardInvocation: for capturing calls to my Backend API object (a shared instance).
Some Background information:
I want to capture the API calls so I can check everytime if I have to refresh my authentication…

orschaef
- 1,287
- 10
- 27
0
votes
1 answer
Function with argument to a NSInvocation method
I have a controller view who is using thoses 2 functions:
[appDelegate getFichesInfo:[[self.fichesCategory idModuleFiche] intValue] ]; //first function
self.fiche = (Fiche *)[appDelegate.fichesInfo objectAtIndex:0];
[appDelegate…

ludo
- 1,479
- 5
- 25
- 50
0
votes
2 answers
NSInvocation needing NSMethodSignature
I have been wondering for a couple of days if NSInvocation should need the NSMethodSignature.
Lets say we want to write our own NSInvocation, my requirements would be as so:
I need a selector SEL
The target object to call the selector on
The…

Omar Abdelhafith
- 21,163
- 5
- 52
- 56
0
votes
4 answers
Invoking a method on a delegate after delay, from an object at the end of it's lifetime
I have a modal view controller that creates core data changes in it's own context, and when I click done, it saves the changes (that dispatches the merge changes notification), notifies the delegate and dismisses.
My problem is that I need the…

Michael Waterfall
- 20,497
- 27
- 111
- 168
0
votes
2 answers
Expect Argument Type to be integer but getting id instead
I'm using the forwardInvocation: feature of objective-c and I need to know what type of argument the method received. In my example I'm passing it an int but getArgumentTypeAtIndex: tells me it's an id instead. Here's a simple example:
@interface…

bendytree
- 13,095
- 11
- 75
- 91
0
votes
2 answers
Unexpected exception with NSInvocation
Following code throws an exception.
vcClass is a Class object (inheritor from UIViewController). Self contains my implementation of viewWillAppear:
SEL viewWillAppearSEL = @selector(viewWillAppear:);
IMP viewWillAppearWithSuperIMP = [self…

user1248568
- 621
- 1
- 9
- 29
0
votes
2 answers
Multiple parameters for @selector
I am creating a game in objective C, and I am stopped by a matter : I have a warning for passing multiple variables on @selector.
What I want to do, is call a method in my UIViewController but after a delay. So I try to make a first method, that…

user2057209
- 345
- 1
- 6
- 19
0
votes
1 answer
NSInvocation problems
So I am running into some issues when I am trying to load information from a file.
myMutableArray=[[NSKeyedUnarchiver unarchiveObjectWithFile:dataFile]retain];
This is the line that gives me the NSinvocation problems
* NSInvocation: warning:…

Alfree92
- 45
- 6
0
votes
1 answer
Should NSInvocation passes self as 2d indice argument?
I am using cocos2d for developing. I have tried to wrap a customized button class. When trying to make the button respond to the selector I assigned to it, I used NSInvocation. In it, the MyButton works like this.
if( target && sel ) {
…

analysiser
- 120
- 11
0
votes
0 answers
NSInvocation throws exception
I'm trying to use an NSTimer with invocation but i have problems with 2 things.
I don't know how to get the Selector to pass Arguments(Xcode crys) or how to get it work in general since it always crashs.
X = [NSTimer…

Coltan
- 73
- 1
- 3