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
1 answer
NSInvocation Leaks
I am trying to setup an NSInovcation system to launch selectors into background threads using performSelectorInBackground: - So far everything is successful when running the system on instance methods (-), but I also want to support class methods…

MikeyM
- 3
- 1
0
votes
1 answer
Forwarding call to foreign -init method
Situation
For a project of mine, I'm building some kind of extension. This extension must have a class that implements a method whose declaration is - (id)initWithBundle:(NSBundle *)bundle.
Issue
My extension has multiple classes, but the host app…

Perceval
- 247
- 2
- 14
0
votes
3 answers
Calling an initialiser using NSInvocation
I have a scenario where the initialiser to use called after allocing an object is not known until runtime and I have no control over it. It also may have various arguments. So currently I'm doing this:
...
id obj = [MyClass alloc];
…

drekka
- 20,957
- 14
- 79
- 135
0
votes
3 answers
NSInvocation making app crash
I'm using NSInvocation as follows:
In my init, I'm writing this in my viewDidLoad:
SEL mySelector;
mySelector = @selector(initParsersetId:type:);
NSMethodSignature * sig = nil;
sig = [[self class]…

neha
- 6,327
- 12
- 46
- 78
0
votes
2 answers
NSInvocation object not getting allocated iphone sdk
I'm doing
NSString *_type_ = @"report";
NSNumber *_id_ = [NSNumber numberWithInt:report.reportId];
NSDictionary *paramObj = [NSDictionary dictionaryWithObjectsAndKeys:
_id_,…

neha
- 6,327
- 12
- 46
- 78
0
votes
1 answer
addTarget fails for NSInvocation/invoke pair
I'm passing targets and actions to UIButtons from dictionary values. This works fine EXCEPT if I try and pass an NSInvocation/invoke pair.
// |self| is a member of |MyClass|, which declares selector |test|
NSDictionary *button1Data = @{…

Thompson
- 1,098
- 11
- 25
0
votes
1 answer
NSUndoManager Delayed Argument Evaluation
I am trying to work with NSUndoManager's prepareWithInvocationTarget. I would like to have something like
[[self.undoManager prepareWithInvocationTarget:self] doSomethingWithObject:[self.aMutableArray objectAtIndex:0]]
where the argument of…

Joseph Johnston
- 533
- 1
- 3
- 14
0
votes
1 answer
Is there a way to Make NSInvocation surport variable parmas function line [NSstring stringWithFormat:..]
Apple doc says "NSInvocation does not support invocations of methods with either variable numbers of arguments or union arguments. "
i searched for hours ,some people says var_list works, but i tryed ,it does Not
but I think there may be a way to…

cydiyo
- 3
- 2
0
votes
2 answers
NSInvocation get target causing EXC_BAD_ACCESS
I have a weird problem with NSInvocation. I'm using it as a return callback when a network operation completes. Let me explain the previous sentence in more detail:
I'm using a custom made network protocol which works over a TCP socket and I have a…

Majster
- 3,611
- 5
- 38
- 60
0
votes
1 answer
objc variadic arguments with primary type and objects
I have a set of lower-layer api, as below:
- (NSDictionary*) startRecord;
- (NSDictionary*) stopRecord;
- (NSDictionary*) switchMicrophone;
- (NSDictionary*) enableAutoRecord:(BOOL)enable;
- (NSDictionary*) deleteFile:(NSString*)filename;
-…

Arton
- 443
- 1
- 6
- 15
0
votes
1 answer
NSInvocation invoke giving bad access in iOS 8
I'm trying to run this code in iOS 8 but I'm getting a bad access error in the method called, this runs ok in iOS 7. Does anyone has a clue about this?
-(double) calcularColumna:(int ) anio :(int) mes :(NSString * ) columna {
NSInvocation *…

Rafael Jimeno
- 626
- 2
- 8
- 20
0
votes
1 answer
NSInvocation to delay calling of method causing EXC_BAD_ACCESS
I'm trying to display a message at the end of a game that shows whether or not the player has won.
Here is the relevant code:
BOOL yes = YES;
NSString *winMessage = [NSString stringWithFormat:@"You win!"];
NSInvocation *inv = [NSInvocation…

ASMach
- 91
- 3
- 9
0
votes
1 answer
NSInvocation has retainArguments, why is there no releaseArguments?
NSInvocation has retainArguments to retain the arguments. Why is there no releaseArguments? Why will the retained arguments be freed?

Boon
- 40,656
- 60
- 209
- 315
0
votes
1 answer
Does [NSInvocation invoke] block execution until done?
If I call invoke on NSInvocation, is it the same as calling performSelector: with the argument waitUntilDone:YES? That is, does invoke block the execution until the called selector is done?
In other words, are the two following code lines exactly…

nyi
- 1,425
- 1
- 15
- 17
0
votes
1 answer
iOS - Timer invocation issue
I wanted to invoke a method if the timer is expired, but the method does not get invoked. Not sure what is going wrong. Any suggestions?
Being called:
- (void)messageSendingReply:(id)messageID
{
//Do something.
}
Calling the above:
-…

bllakjakk
- 5,045
- 1
- 18
- 28