forked from pmougin/F-Script
-
Notifications
You must be signed in to change notification settings - Fork 8
/
DOCustom.m
73 lines (56 loc) · 974 Bytes
/
DOCustom.m
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#import <Foundation/Foundation.h>
#import "DOCustom.h"
@implementation DOCustom : NSObject
-(NSInteger)echoInt:(NSInteger)arg
{
return arg;
}
- (NSInteger) getValue
{
return i;
}
- (byref NSArray*)getNSArrayByRef
{
return [NSArray arrayWithObjects:[NSScanner scannerWithString:@"hello"], [NSProcessInfo processInfo], nil];
}
- (byref NSNumber*)getNSNumberByRef
{
return [NSNumber numberWithDouble:30];
}
- (byref NSString*)getNSStringByRef
{
return @"I am an NSString passed by ref";
}
- (void) incr
{
i++;
}
-(BOOL)isEqual:(id)object
{
return [object isKindOfClass:[DOCustom class]] && i == [object getValue];
}
-(id)perform:(SEL)selector on:(id)target with:(id)argument
{
return [target performSelector:selector withObject:argument];
}
-(oneway void) quit
{
exit(0);
}
-(void) setValue:(NSInteger)value
{
i = value;
}
- testTimeout
{
while(1);
}
- (id) testStr
{
return @"toto";
}
-(SEL) test2
{
return @selector(class);
}
@end