File: InvocationOperation.m

package info (click to toggle)
agenda.app 0.47-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,008 kB
  • sloc: objc: 8,103; makefile: 16; sh: 5
file content (34 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* emacs buffer mode hint -*- objc -*- */

#import <Foundation/Foundation.h>
#import "InvocationOperation.h"

@implementation InvocationOperation
- (id)initWithInvocation:(NSInvocation *)inv
{
  if ((self = [super init]))
    _invocation = [inv retain];
  return self;
}
- (id)initWithTarget:(id)target selector:(SEL)sel object:(id)arg
{
  NSInvocation *inv;

  inv = [NSInvocation invocationWithMethodSignature:[target methodSignatureForSelector:sel]];
  [inv setTarget:target];
  [inv setSelector:sel];
  if (arg)
    [inv setArgument:&arg atIndex:2];
  return [[InvocationOperation alloc] initWithInvocation:inv];
}
- (void)dealloc
{
  [_invocation release];
  [super dealloc];
}
- (void)main
{
  NSDebugLLog(@"SimpleAgenda", @"%@", [_invocation description]);
  [_invocation invoke];
}
@end