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!)
}
Just add heightForRowAt
in your code as shown below:
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 80
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.