1

I've followed a few tutorials and I cant seem to adapt them to my needs. Simply I have a manager objects that returns a NSInvocation to be stored and invoked at a later point in the app.

and when I run the application, my method signature is null and even trying to assign a NSInvocation from a getter is causing a SIGABRT.

@interface Cars : NSObject
+ (NSArray *)all;
@end

cars all method just returns an array "1","2","3","4". and in my object manager I do this:

- (NSInvocation *) cars_ALL {

    NSMethodSignature *ca   = [Cars instanceMethodSignatureForSelector:@selector(all)];
    NSLog(@"%@", ca);

    return [NSInvocation invocationWithMethodSignature:ca];
}

and I call it like this:

NSInvocation *cinv = [myObjectManager cars_ALL];

thats it, im not even up to invoking or assigning the target etc of the invocation. anything I try just doesn't work out.

0x8badf00d
  • 6,391
  • 3
  • 35
  • 68
cream-corn
  • 1,820
  • 14
  • 26
  • It would help to know what problem you're trying to solve; chances are this is neither the simplest nor the best approach. – jlehr Jan 05 '12 at 00:22
  • I recommend to use blocks instead of NSInvocation. – hoshi Jan 05 '12 at 02:14
  • hrmmm im not sure if that will work? my vision for this is to somehow save an invocation for later use, so i dont need to know what model object i need to call Instead i simply create my object with the correct model invocation and use it as i please? im open to suggestions i just thought of using NSInvocation – cream-corn Jan 05 '12 at 03:53

0 Answers0