Hi,
I can’t sucessfully use async request with an IOS client connected to a Delphi server.
At the begin I thought that it was due to the fact that I’m making a custom library.
But with the IOS template, if I try I can’t get the didReceiveTable event fired.
My code is :
DAAsyncRequest *ar = [rda beginGetDataTables:tableNames start:NO];
[ar setDelegate:self];
[ar setContext:@“beginGetDataTables”];
[ar start];
should not. asynchronous requests are a purely client-side thing on the DA/x library.
are you sure you implement the right requestDidFail* event of the delegate? can you try also assigning the delegate for the RDA and implementing any related RDA delegate methods, to gather more info? what happens if you assign a failureBlock to the request?
With NSZombies enabled, I see an error :
[CFArray release]: message sent to deallocated instance 0x6d9ea30
0x00093cc0 <+0544> jmp 0x93cc5 <-[ROClientChannelThreadRunner threadMethod]+549>
in server side no error and events DataStreamerInitialized and DataStreamerFinalized are fired.
The XCode version of DA is 6.0.55.963.
I attach the Obj-C files, most of their content are generated by the DA wizard.
Thanks Marc for your reply.
I have tryed to show the call stack but with this F… Xcode 4.x things are always more complicated.
here’s what I get, I can get more details (do you know how to get more detail ?)
Note that I had same problem without zombies.
Analysing your testcase I’ve found the cause of failure.
You are trying to load data asynchronously inside the background thread (notice that loadInitialData method spawn background thread and invoke threadedLoadInitialData there. threadedLoadInitialData invokes downloadData which in turn call beginGetData - which spawn another nested thread).
Failure happens because your background thread ends and releases before the async getData completes.
But async request requires original thread since it try to call delegate methods on it.
In order to solve that you need to use only synchronous calls inside the downloadData method.
Since this method already runs in background then you will not get any UI locking.
if you want to use any other async calls then you can run them from the main thread.
Yes!!!
nice catch Alex.
it works on the sample now. on ti module it was another story, but solved also using ENSURE_UI_THREAD_1_ARG(args);
Thanks again.
Will add now most of async method to the module.
Regards