我JSON
Respose是SWIFTY JSON工作不更新到Xcode的8
{
code = 1;
document = (
{
Address1 = "<null>";
Address2 = "<null>";
City = "<null>";
CompanyID = 1;
CompanyName = Innohabit;
ContactNumber = "<null>";
Designation = "<null>";
DesignationID = 36;
DesignationName = dev;
Email = "[email protected]";
FCMRegistrationToken = "";
GCMRegistrationToken = "";
Gender = Male;
ID = 9;
IsActive = 1;
IsFirstLogin = 1;
LastLogin = "2016-09-21 05:45:33";
Name = "Uday Mishra";
Password = "";
ProfilePic = "";
RegisterationDate = "2016-03-04 07:42:42";
UserTwitter = "<null>";
Username = "[email protected]";
}
);
message = "Record found";
status = success;
}
,並試圖轉換使用Swifty Json
喜歡這個
case .success:
print(response)
let jsonResponse = JSON(response.data)
print("JSON")
let jsonData = jsonResponse["document"]
print(jsonResponse)
print(jsonData[0])
的respose但我沒有得到期望的結果,輸出是
{
code = 1;
document = (
{
Address1 = "<null>";
Address2 = "<null>";
City = "<null>";
CompanyID = 1;
CompanyName = Innohabit;
ContactNumber = "<null>";
Designation = "<null>";
DesignationID = 36;
DesignationName = dev;
Email = "[email protected]";
FCMRegistrationToken = "";
GCMRegistrationToken = "";
Gender = Male;
ID = 9;
IsActive = 1;
IsFirstLogin = 1;
LastLogin = "2016-09-21 05:45:33";
Name = "Uday Mishra";
Password = "";
ProfilePic = "";
RegisterationDate = "2016-03-04 07:42:42";
UserTwitter = "<null>";
Username = "[email protected]";
}
);
message = "Record found";
status = success;
}
JSON
unknown
null
正如你可以看到響應正在打印,但th Ë打印(jsonResponse)和打印(jsonData [0]) 是印刷未知和空誰能幫助我,我如何從DataRespose
連載中的數據正確地爲JSON
格式請提出替代方法或如果我在做任何錯誤,請幫助我。
莢 'SwiftyJSON',:git的=> 'https://github.com/appsailor/SwiftyJSON.git':使用同樣的事情在我的POD文件 –
我還在不要求幫助。 –
支=> 'swift3' –