草庐IT

answersBody

全部标签

arrays - 如何将 nil 添加到数组中?

我想将nil添加到数组中,设置为answersBody。varanswersBody=[String]()当answer_body为nil时,返回error,请问如何解决?Alamofire.request(.GET,"http://localhost:3000/api/v1/questions/index",parameters:nil,encoding:.JSON).responseJSON{(request,response,data,error)invarjsonObj=JSON(data!)varquestions_count=jsonObj["questions"].cou