blob: 089bfa1cffe55ed41762db379de61de072663220 (
plain)
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
|
{ %target=darwin }
{ %cpu=powerpc,powerpc64,i386,x86_64,arm }
{ Written by Jonas Maebe in 2009, released into the public domain }
{$mode objfpc}
{$modeswitch objectivec1}
var
a: NSObject;
begin
a:=NSObject(NSObject(NSObject.alloc).init);
if a.respondstoselector_(objcselector('isKindOfClass:')) then
writeln('ok string selector!')
else
halt(1);
if a.respondstoselector_(objcselector(NSObject.init)) then
writeln('ok method selector!')
else
halt(2);
if (a.self<>id(a)) then
halt(3);
if (a.superclass<>nil) then
halt(4);
a.release;
end.
|