|
@@ -20,6 +20,11 @@ type
|
|
|
procedure extraproc(a: longint); override;
|
|
procedure extraproc(a: longint); override;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
+ MyObject2 = objcclass(NSObject)
|
|
|
|
|
+ // overrides extraproc added to NSObject
|
|
|
|
|
+ procedure extraproc(a: longint); override;
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
procedure MyCategory.extraproc(a: longint);
|
|
procedure MyCategory.extraproc(a: longint);
|
|
|
begin
|
|
begin
|
|
|
if a<>1 then
|
|
if a<>1 then
|
|
@@ -33,10 +38,18 @@ procedure MyObject.extraproc(a: longint);
|
|
|
inherited extraproc(1);
|
|
inherited extraproc(1);
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
+procedure MyObject2.extraproc(a: longint);
|
|
|
|
|
+ begin
|
|
|
|
|
+ if a<>3 then
|
|
|
|
|
+ halt(3);
|
|
|
|
|
+ inherited extraproc(1);
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
var
|
|
var
|
|
|
a: NSObject;
|
|
a: NSObject;
|
|
|
b: MyObject;
|
|
b: MyObject;
|
|
|
|
|
+ c: MyObject2;
|
|
|
begin
|
|
begin
|
|
|
a:=NSObject.alloc.init;
|
|
a:=NSObject.alloc.init;
|
|
|
a.extraproc(1);
|
|
a.extraproc(1);
|
|
@@ -44,4 +57,7 @@ begin
|
|
|
b:=MyObject.alloc.init;
|
|
b:=MyObject.alloc.init;
|
|
|
b.extraproc(2);
|
|
b.extraproc(2);
|
|
|
b.release;
|
|
b.release;
|
|
|
|
|
+ c:=MyObject.alloc.init;
|
|
|
|
|
+ c.extraproc(2);
|
|
|
|
|
+ c.release;
|
|
|
end.
|
|
end.
|