mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 02:49:37 +02:00

implemented in Pascal). See http://wiki.freepascal.org/FPC_PasCocoa#Category_declaration for syntax details git-svn-id: trunk@14196 -
26 lines
410 B
ObjectPascal
26 lines
410 B
ObjectPascal
{ %target=darwin }
|
|
{ %cpu=powerpc,powerpc64,i386,x86_64,arm }
|
|
{ %fail }
|
|
|
|
{$modeswitch objectivec1}
|
|
|
|
type
|
|
ta = objcclass(NSObject)
|
|
end;
|
|
|
|
ca = objccategory(ta)
|
|
procedure categorymethod; message 'categorymethod';
|
|
end;
|
|
|
|
procedure ca.categorymethod;
|
|
begin
|
|
end;
|
|
|
|
var
|
|
a: NSObject;
|
|
begin
|
|
a:=ta(ta.alloc).init;
|
|
{ should fail because the category is for ta, not for nsobject }
|
|
a.categorymethod;
|
|
end.
|