Swift如何将字符串分配给UITextField?

时间:2015-05-07 06:26:32

标签: swift uitextfield

@IBOutlet weak var resultProcessed: UITextField!
var str:String = "Mike is here"
resultProcessed = str

给出错误:无法将类型为'String'的值分配给'UITestField!'类型的值

1 个答案:

答案 0 :(得分:8)

resultProcessed.text = str

您需要将其分配给text属性。