fpc/tests/webtbs/tw39375.pp
Jonas Maebe fcb646bc3b obcpas: fix categories implementing protocols
Allocate the ImplementedInterfaces array for them and save to/load from ppu

Solves 
2021-09-25 16:15:45 +02:00

32 lines
704 B
ObjectPascal

{ %target=darwin,ios,iphonesim }
program Project1;
{$mode objfpc}{$H+}
{$ModeSwitch objectivec1}
type
CBCentralManager = pointer;
CBCentralManagerDelegateProtocol = objcprotocol external
procedure centralManagerDidUpdateState (central: CBCentralManager); message 'centralManagerDidUpdateState:';
end;
Test=objccategory(NSObject,CBCentralManagerDelegateProtocol)
procedure centralManagerDidUpdateState (central: CBCentralManager);
end;
var
called: boolean = false;
procedure Test.centralManagerDidUpdateState (central: CBCentralManager);
begin
called:=true;
end;
var
o: NSObject;
begin
o := NSObject.alloc.init;
o.centralManagerDidUpdateState(nil);
if not called then
halt(1);
end.