Unescaped control character around character 981.Error while parsing JSON

前端 未结 4 909
长发绾君心
长发绾君心 2021-01-11 23:58

Error Domain=NSCocoaErrorDomain Code=3840 \"Unescaped control character around character 981.\" UserInfo={NSDebugDescription=Unescaped control character a

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 00:44

    to be sure (as people make fool copy/paste...) , I build my object safe: ..

    private final func fillWith(
         id: Int,
         name: String?
    ) {
        
        self.id = id
        self.productName = name?.replacingOccurrences(of: "\t", with: "")
        self.productName = self.productName?.replacingOccurrences(of: "\n", with: "")
    

    So no prob when sending Up.

提交回复
热议问题