ios - swifty json crashing a lot -


i using swiftyjson parse json responses server.

the app crashing lot (getting reports on crashlytics) can't seem figure out happening.

the line of code of different point is

let jsondict = json(data: data, options: nsjsonreadingoptions.allowfragments, error: nil) 

this same line used parse of json responses different endpoints.

the basic code doing these requests is:

nsurlconnection.sendasynchronousrequest(     req,     queue: queue)     { (res: nsurlresponse!, data: nsdata! , err: nserror!) -> void in         let jsondict = json(data: data, options: nsjsonreadingoptions.allowfragments, error: nil) // , crashes on line 

there no errors on backend , responses seem sending down 200 ok response code (although hard match up)

is there way can put try catch around line doesn't crash app?

heres screen crashlytics screenshot crashlytics (fabric)

you should figure out why it's crashing instead of trying mask issue via do/try/catch. start removing backend call , feed sample json that's representative of server return json call , see if crashes there.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -