所以我有这个UITableView
单元有4 UITextField
,我想获得他们的值按钮点击。如何从UITableViewCell获取文本字段的值?
此代码不检索任何值。
@IBAction func printBtnAction(_ sender: Any) {
let cell = self.myTableView.dequeueReusableCell(withIdentifier: "manualAddC1") as! AddFriendC1Cell
let alias = cell.aliasTextField.text!
let primaryPhone = cell.primaryPhoneTextField.text!
let secondaryPhone = cell.seondaryPhoneTextField.text!
let email = cell.emailAddressTextField.text!
print("Alias: \(alias), Phone: \(primaryPhone), Phone2: \(secondaryPhone), Email: \(email)")
}
更多细节将是有益的。 –
你打印输出?怎么了 ?请解释更多 –
放置表格视图的屏幕截图 – KAR