I have a service written in Delphi which has the following structure define, along w/ the following service method:
TMillerAdInformation = class(TROComplexType)
//details removed
end;
function OpenAd(const AAdNumber: AnsiString; const AEntryYear: AnsiString; var AAdData: TMillerAdInformation; out ALog: AnsiString; const ADatabase: Integer): Boolean;
I have written a .NET application in Oxy that accesses this (and other) methods in an asynchronous way via anonymous methods, and everything works great.
I am now trying to write my first “real” Nougat app for OSX and i’m essentially rewriting my .NET app in Nougat. In the codegen for Nougat, the class/method looks like this:
type
TMillerAdInformation = public class(ROComplexType)
method beginOpenAd(
AAdNumber: String;
AEntryYear: String;
AAdData: ^TMillerAdInformation;
ADatabase: Integer
) startWithBlock(___block: block(arg: ROAsyncRequest)): ROAsyncRequest;
method endOpenAd(
AAdData: ^TMillerAdInformation;
ALog: ^String;
__asyncRequest: ROAsyncRequest): Boolean;
What I am seeing in Nougat is that when I call beginOpenAd w/ an async call, it doesn’t seem to complete.
that call is the 3rd in a series of nested anon method calls so that I could call 3 methods from my service in sequence. here is the code:
ROService.beginAdExists(AdNumEdit.stringValue,AdYearEdit.stringValue,PubNumEdit.stringValue,True,0) startWithBlock(
method (aRequest4: ROAsyncRequest)
(* ANONYMOUS METHOD CALL #1 *****)
begin
AdExists := ROService.endAdExists(aRequest4);
if AdExists then
NSLog('Ad found!!!')
else
NSLog('Ad not found.');
if AdExists then
begin
// get ad number first.....
ROService.beginMillerNumForPubNum(AdNumEdit.stringValue,AdYearEdit.stringValue,PubNumEdit.stringValue,0) startWithBlock(
(* ANONYMOUS METHOD CALL #2 ******)
method (aRequest5: ROAsyncRequest)
begin
MillerAdNum := ROService.endMillerNumForPubNum(aRequest5);
NSLog('Miller Ad #'+MillerAdNum);
NSLog('Calling Open Ad....');
ROService.beginOpenAd(MillerAdNum,AdYearEdit.stringValue,@AdInfo,0) startWithBlock(
(* ANONYMOUS METHOD CALL #3 ******)
method (aRequest6: ROAsyncRequest)
begin
AdOpened := ROService.endOpenAd(@AdInfo,@LogStr,aRequest6);
if AdOpened then
NSLog('OpenAd succeeded')
else
NSLog('OpenAd failed');
end);
end);
end;
end);
What I see (or don’t see) is the last NSLog() calls. I see ‘Calling Open Ad…’, but nothing after that.
Is there a bug in the Nougat codegen?
details: Windows 7, VS 2012, Oxygene 6.20.60.1393, ROSDK for .NET/Cocoa/Delphi 7.0.70.1095
Thanks!
Alan