delphi - Invalid class typecast exception ,How I can solve it? -


i try use firebase4delphi there no documentation , , got exception invalid class typecast when try use !

i have got error when executing function (it compiles normally).

procedure tfirebasechatfacade.parseresponse(aresp: ifirebaseresponse); var   obj: tjsonobject;   i: integer;   key: string;   chatmsg: tchatmessage;   jsonresp: tjsonvalue; begin   jsonresp := tjsonobject.parsejsonvalue(aresp.contentasstring);   if (not assigned(jsonresp)) or (not(jsonresp tjsonobject))   begin     if assigned(jsonresp)       jsonresp.free;     exit;   end;   obj := jsonresp tjsonobject;   try     tmonitor.enter(fmessages);     try       := 0 obj.count - 1       begin         key := obj.pairs[i].jsonstring.value;         if not fmessages.containskey(key)         begin           chatmsg := tchatparser.getmessage             (obj.pairs[i].jsonvalue tjsonobject);   //exception raise here.           fmessages.add(key, chatmsg);           onnewmessage(chatmsg);           removeoldermessage;         end;       end;           tmonitor.exit(fmessages);     end;       obj.free;   end; end; 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -