OGeek|极客世界-中国程序员成长平台

标题: ios - 如何在swift3中将soap响应传递给下一个viewController [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 18:52
标题: ios - 如何在swift3中将soap响应传递给下一个viewController

我正在使用 SOAP 开发 swift3。我收到了来自 soap 的回复,但我无法将此回复发送到我的 secondView Controller

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!

    }
}

请帮忙谢谢



Best Answer-推荐答案


您说“无法发送此回复”是什么意思 - 无法编译代码 - 执行时崩溃 - 似乎一切正常,但没有任何更新?

为了清晰起见,您不应该使用大写的变量名称 - DestViewController1 应该只用于定义类或结构,而 destViewController1 将是更好的变量名 - secondViewController 应该是 SecondViewController

关于ios - 如何在swift3中将soap响应传递给下一个viewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42082682/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4