Ios 如何在swift3中将soap响应传递给下一个viewController
我正在用肥皂制作swift3。我收到了来自soap的响应,但无法将此响应发送到我的secondView控制器Ios 如何在swift3中将soap响应传递给下一个viewController,ios,soap,Ios,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/so
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
请帮我谢谢你当你说“无法发送此回复”是什么意思 -无法编译代码 -行刑时崩溃 -一切看起来都正常,但没有任何更新 作为一个小点,为了清晰起见,您不应该使用大写的变量名-
DestViewController1
应该只用于定义类或结构,而DestViewController1
将是更好的变量名-secondViewController
应该是secondViewController
- 第二个控制器中是否有变量
responseText
- 您将SOAP响应保存在哪里
似乎没有什么意义。你是说self.responseText.value()`self.value()
状态
中,因此我想将该响应传递给我的secondViewController,是的,我有变量responseText
函数解析器(parser:XMLParser,foundCharacters string:string){if currentElementName==“status”{status.append(string)print(status)}
请参见[
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!
}
}