You are not logged in.
Pages: 1
Thanks for the answer, but I couldn't find what this T*ObjArray is.
But if I was to change TObjectList<TEstado> to a dynamic array of TEstado, could I serialize it then? How?
Thanks again.
I have the following two classes:
type TListaEstados = class
private
flista:TObjectList<TEstado>;
public
constructor Create;
published
property estados:TObjectList<TEstado> read flista write flista;
end;
type
TEstado = class
private
fcodigo: Integer;
fnome: string;
fsigla: string;
published
property codigo: Integer read fcodigo write fcodigo;
property nome: string read fnome write fnome;
property sigla: string read fsigla write fsigla;
end;
And I want to serialize a TListaEstados object. Ideally, I'd like to use the
MyString := SynCrossPlatformJson.ObjectToJSON(MyObject);
function, but as it is, it returns me json like this:
{"estados":"null"}
I already tried inheriting from TInterfacedCollection, but it gave me an Access Violation. I also tried to register the class like below:
TJSONSerializer.RegisterClassForJSON(TListaEstados);
And the output is the same as above. So, where should I begin? How can I serialize this?
Thanks.
Pages: 1