2019-04-26 22:44:30 -04:00
|
|
|
#import "simple.h"
|
|
|
|
|
|
|
|
@implementation ClassOne
|
|
|
|
|
2019-04-30 06:59:05 -04:00
|
|
|
- (instancetype) init
|
2019-04-26 22:44:30 -04:00
|
|
|
{
|
|
|
|
ClassOne *ret;
|
|
|
|
ret = [ClassOne alloc];
|
|
|
|
ret->i1 = 12;
|
|
|
|
ret->p1 = malloc(sizeof(int));
|
|
|
|
*ret->p1 = 16;
|
|
|
|
ret->a1[0] = 4;
|
|
|
|
ret ->a1[1] = 5;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (int) geti1
|
|
|
|
{
|
|
|
|
return i1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (int *) getp1
|
|
|
|
{
|
|
|
|
return p1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (int (*)()) getf1
|
|
|
|
{
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (int) hi1:(struct stru)in
|
|
|
|
{
|
|
|
|
return in.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (int) hi2:(struct stru*)in
|
|
|
|
{
|
|
|
|
return in->a;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (struct stru) nstru1
|
|
|
|
{
|
|
|
|
struct stru ret;
|
|
|
|
ret.a = 7;
|
|
|
|
ret.b = 8;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
- (struct stru*) nstru2
|
|
|
|
{
|
|
|
|
struct stru* ret;
|
|
|
|
ret = malloc(sizeof(struct stru));
|
|
|
|
ret->a = 9;
|
|
|
|
ret->b = 10;
|
|
|
|
return ret;
|
|
|
|
}
|
2019-04-29 11:46:48 -04:00
|
|
|
- (void) hi:(id)in
|
|
|
|
{
|
|
|
|
NSLog(@"hi");
|
|
|
|
}
|
|
|
|
- (void) hi3:(id)in
|
|
|
|
{
|
|
|
|
NSLog(@"hi");
|
|
|
|
}
|
2019-04-26 22:44:30 -04:00
|
|
|
@end
|
|
|
|
|
2019-04-29 11:46:48 -04:00
|
|
|
@implementation ClassTwo
|
2019-04-30 06:59:05 -04:00
|
|
|
- (instancetype) init
|
2019-04-29 11:46:48 -04:00
|
|
|
{
|
|
|
|
return [super init];
|
|
|
|
}
|
|
|
|
@end
|