Я пытаюсь показать webview в ячейке таблицы. Ошибка Неожиданно найдено нуль при разворачивании необязательно всплывает при «let webView = cell.viewWithTag (12) as! UIWebView«. Тег webView равен 12 (перекрестная проверка многократно). dateLabel и captionLabel работают нормально.Не удается найти UIWebView в TableView
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell : UITableViewCell!
cell = tableView.dequeueReusableCellWithIdentifier("idCellPost", forIndexPath: indexPath)
let dateLabel = cell.viewWithTag(10) as! UILabel
let captionLabel = cell.viewWithTag(11) as! UILabel
let webView = cell.viewWithTag(12) as! UIWebView
dateLabel.text = "8/18/2015"
captionLabel.text = "Dummy text."
webView.loadRequest(getRequest())
webView.scalesPageToFit = true
return cell
}
Я уже определил веб-представление с помощью раскадровки. – crysis
dateLabel должен иметь тег 10, captionLabel тег 11 и тег webView 12 – Jamil
да, это теги, перекрестные проверили их так много раз – crysis