2017-10-21 97 views
-1
func initProducts(cateories: Categories){ 
     products = DataServices.instance.getProducts(forCategorieTitle: cateories.nameLabel) 
     //productTitleName.text = cateories.nameLabel 
     self.productTitleName!.text = cateories.nameLabel 
    } 

在本節我是面對這一誤差的誤差。臉一些誤差在我的迅速3代碼線程1:EXC_BAD_INSTRUCTION(代碼= EXC_1386_INVOP,子碼=爲0x0),這是我的

+0

是'填充self.productTitleName'? – tadman

+0

我認爲productTitleName outlet不會與UI元素連接,請檢查它是否嘗試分配「productTitleName?.text」而不是「productTitleName!.text」 – Bharath

回答

0

使用這樣的:

if let productTitle = self.productTitleName { 
    productTitle.text = cateories.nameLabel 
} 
+0

這不能解決實際問題。它只是避免了崩潰。 – rmaddy

相關問題