Swift: Retrieving values out of TableView Textfields

后端 未结 2 1870
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 12:37

I just tried to retrieve all my textfield values out of my TableView. It worked for 10 of 11 cases. I tried the following:

    let journeyIDTextField = tableView         


        
2条回答
  •  悲哀的现实
    2021-01-27 13:09

    I think one issue is that you're force unwrapping journeyIDTextField.cellInputTextfield.text when it equals nil. One other potential issue I see is that your textfield text will get wiped when you scroll due to cell reuse. For properly using a textfield in a reused cell, see this question.

提交回复
热议问题