0
我使用一個情節串連圖板layouts.The過程是這樣的兼容編碼-:故事板:該類不是關鍵值對鍵
A [的UIViewController] ----模態---> [UINavigationController的] - ----根視圖控制器-----> B [UIViewController中]
現在我需要的值,從A到B;所以我寫在A中的下面的代碼:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
[segue.destinationViewController setValue:@"test" forKey:@"type"];
}
但在執行時間,出現[*終止應用程序,由於未捕獲的異常'NSUnknownKeyExc eption',原因是:'[setValue:forUndefinedKey:]:這個類不是關鍵字編碼兼容的密鑰類型。']
可以看出值已到達UINavigationController。 如何傳遞參數UINavigationController根視圖[b]?