我想知道的是,它是必需的在viewDidLoad和UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myidentifier"];
在cellForRowAtIndexPath?[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"myidentifier"];
?對於iOS 10.0?在iOS 10中爲tableviewcell編寫registerWithClass或registerWithNib是否強制?
因爲在iOS 10.0測試版中,當我沒有註冊類時它殺死了應用程序。但它可以在iOS的早期版本中使用,無需註冊。
謝謝大家。
稱它是'[self.tableView的registerClass:[UITableViewCell類,] forCellReuseIdentifier:@ 「myidentifier」 ];'在ROWATINDEX的內部細胞 –
您使用Xib或故事板嗎? – Harsh
No Just Class。和@ Anbu.Karthik它工作正常,當我註冊在viewdidload。我的問題是這是強制性的?如果是,那爲什麼? –