我用這個代碼比較,如果讓在迅速?
if let breedVaccRecorddStr = self.petInfoDict.objectForKey("breedvaccinationrecord") {
}else{
ALToastView.toastInView(UIApplication.sharedApplication().keyWindow, withText: "No Data Found")
}
這是我的迴應
{
breed = dabour;
breedvaccinationrecord = "";
"city_registration" = 123146515;
"date_of_birth" = "12-10-2014";
"emergency_contacts" = 1245749876;
gender = male;
"owner_name" = Environmental;
"pt_id" = 4150;
"pt_images" = "";
"pt_name" = demo123;
ptinfo = "http://www.petcsi.com/wp-content/uploads/2015/12/jacky42.jpg";
"prop_name" = "Bella Vida Estates";
"qr_tag" = 5215653454;
species = test;
"vaccination_records" = test123;
vaccinationrecord = "";
"vet_info" = "";
},
常量不能是零,因此執行,如果塊。但我期待輸出「沒有數據」。他們可能是圖像URL在那個關鍵如何檢查這個?
breedvaccinationrecord give may image url我想檢查它沒有。 –
你的代碼已經檢查'breedvaccinationrecord'不是零。我不明白你的問題。 – Michael
我得到「」字符串如果讓塊。 –