mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 07:38:11 +02:00
29 lines
590 B
ObjectPascal
29 lines
590 B
ObjectPascal
{ %target=darwin }
|
|
{ %cpu=powerpc,powerpc64,i386,x86_64,arm,aarch64 }
|
|
|
|
{ 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.
|