dongpao5261 2015-08-21 12:22
浏览 51

swift字符串转换为字符串

I have an app that has to send a string from one viewcontroller to another. I am using prepareforsegue which works fine i can print the var out on the other viewcontroller in a UILabel.

But now I am trying to send it to my php script which communicates with my database. The problem is I am receiving the var that is being send over as var helpCode:string?

Then the function runs which is NSString and I can't get it to work. I have tested it by just typing the phrase in the function as NSString and i get the correct response from the server. But when I set it up as it has to be with variables i get a fatal error because it is sending nil. When I try to send it as NSString i get string can't be converted to NSString. How can I do this?

I see lots of solutions for nsstring to string but not the other way around. Or am i doing something else wrong.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度