Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling TDataSet results in Xcode from Delphi XE2 Datasnap Server

I'm looking at the feasibility of using a Delphi XE2 DataSnap server pushing data from a SQL server through to an iPad application.

I've written the Datasnap server application, and am looking now at the iOS application. The TServerMethod returns the data as a TDataSet in iOS. What isn't clear is how does one go about extracting the resulting TDataSet in Xcode as a NSMutableArray? Below is the generated code in the DSProxy.m: -

-(id) getTServerMethods1_GetMileageList {
return  [NSArray arrayWithObjects:
  [DSRESTParameterMetaData parameterWithName: @"Value" withDirection:Input withDBXType:WideStringType withTypeName:@"string"],
  [DSRESTParameterMetaData parameterWithName: @"" withDirection:ReturnValue withDBXType:TableType withTypeName:@"TDataSet"],
nil];

}

like image 594
James Avatar asked Sep 11 '11 16:09

James


2 Answers

I strongly suggest you to head to this article entitled DataSnap connectivity for iOS using Delphi XE2 and FireMonkey posted on EDN by Anders Ohlsson.

like image 90
menjaraz Avatar answered Oct 31 '22 14:10

menjaraz


It looks like straight JSON that gets sent down to the client - so you should be able to use existing api's to turn it into NSStrings, NSNumbers, etc. Slightly similar to here: NSJSONSerialization gives me error "Duplicate key"

like image 26
Scott Corscadden Avatar answered Oct 31 '22 14:10

Scott Corscadden