ios - Errors thrown from here are not handled....bug -


could please explain why i'm getting error based on other code located?

enter image description here

why compile fine:

func serializejsondata(jsondata: nsdata) -> nsdictionary {     {         let searchresultsjson: nsdictionary = try nsjsonserialization.jsonobjectwithdata(jsondata, options: .mutablecontainers) as! nsdictionary         return searchresultsjson     } catch let error nserror {         print("json error: \(error.localizeddescription)")         let returndictionary = [:]         return returndictionary     } }   func parseforms(formsarray: nsarray) -> nsarray {      var retval = [searchformobject]()     form in formsarray as! nsdictionary { }      return retval } 

when when switch methods around this:

func parseforms(formsarray: nsarray) -> nsarray {      var retval = [searchformobject]()     form in formsarray as! nsdictionary { }      return retval }  func serializejsondata(jsondata: nsdata) -> nsdictionary {     {         let searchresultsjson: nsdictionary = try nsjsonserialization.jsonobjectwithdata(jsondata, options: .mutablecontainers) as! nsdictionary         return searchresultsjson     } catch let error nserror {         print("json error: \(error.localizeddescription)")         let returndictionary = [:]         return returndictionary     } } 

i error on

let searchresultsjson: nsdictionary = try nsjsonserialization.jsonobjectwithdata(jsondata, options: .mutablecontainers) as! nsdictionary 

is ide thing or have actual error in code??


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -