aboutsummaryrefslogtreecommitdiff
path: root/tests/Introspection.m
blob: d54cc0ffa0b907c0d380e2dbcda302a0812d4943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <Paradox/Core.h>
#include <stdio.h>

@interface MyClass : PXObject
- (void)sayHello;
@end

@implementation MyClass

- (void)sayHello {
	printf("Hello!");
}

@end

int main(void) {
	printf("Object introspection test\n");
	MyClass *instance = [MyClass new];
	printf("class = %s\n", class_getName([instance class]));
	printf("superclass = %s\n", class_getName([instance superclass]));
	printf("className = %s\n", [instance className]);
	printf("isMemberOfClass:MyClass = %s\n", [object isMemberOfClass:[MyClass class]]);
}