Reputation: 321
I have two labels in my cell in tableview but when I run my app it shows only one label and prints this in console
[2142:52393] Warning: Attempt to present <UIAlertController: 0x7f89d80cc000> on <IAuditor.ViewController: 0x7f89d6d13600> whose view is not in the window hierarchy!
what I have made
what I get from data now
what I want
let context = appDel.persistentContainer.viewContext
let results = try! context.fetch(request)
for result in results as! [NSManagedObject] {
let formNameIs = result.value(forKey: "formName") as? String
let formDescIs = result.value(forKey: "formDesc") as? String
cell.titleLabel.text = formNameIs!
cell.descLabel.text = formDescIs
print(formNameIs!, formDescIs!)
}
Upvotes: 3
Views: 655
Reputation: 71852
Just add heightForRowAt
in your code as shown below:
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 80
}
Upvotes: 2