Hello,
i'm using the JSONGenerator to generate a json string from a list of maps.
Example:
i received the following crash report from a user:
I found a solution on stackoverflow:
but don't know how to use it with the json generator
Unfortunately I cannot reproduce the error, I have used all the special characters my keyboard has to offer, I have even created json strings, but nothing causes a crash.
Am I missing something? I would be grateful for any advice, thanks
Alex
i'm using the JSONGenerator to generate a json string from a list of maps.
Example:
B4X:
Dim lst As List
lst.Initialize
For i = 0 To 5 -1
lst.Add(CreateMap("timestamp":DateTime.Now,"text":"test" & i))
Next
Dim jg As JSONGenerator
jg.Initialize2(lst)
Log(jg.ToPrettyString(2))
i received the following crash report from a user:
B4X:
*** Terminating app due to uncaught exception '', reason: 'Error parsing string: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0}'
I found a solution on stackoverflow:
iOS Swift:"JSON text did not start with array or object and option to allow fragments not set."
When I converting Json string to dictionary in swift I got the Issue:Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set."
stackoverflow.com
Unfortunately I cannot reproduce the error, I have used all the special characters my keyboard has to offer, I have even created json strings, but nothing causes a crash.
Am I missing something? I would be grateful for any advice, thanks
Alex