我正在使用SOAP工作swift3。我收到了soap的回复,但我无法将此回复发送到我的secondView控制器
Body: <<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
<ns1:doRegisterUserResponse
xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"><response><status
xsi:type="xsd:string">successful</status></response>
</ns1:doRegisterUserResponse></SOAP-ENV:Body></SOAP-
ENV:Envelope>>.value
Response = successful
我试图传递
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
{
if (segue.identifier == "secondView")
{
let DestViewController1:secondViewController = segue.destination as! secondViewController
DestViewController1.responseText = self.value(forKey: status as String) as! String!
}
}
请帮助谢谢你
答案 0 :(得分:0)
当你说“无法发送此回复”时,你是什么意思 - 无法编译代码 - 执行崩溃 - 一切似乎都有效,但没有更新?
作为帮助明确性的一个小点,您不应该使用大写变量名称 - DestViewController1
应仅用于定义类或结构,而destViewController1
将是更好的变量名称 - { {1}}应为secondViewController
SecondViewController
?responseText
似乎没有多大意义。你的意思是self.responseText.value()`?