为了在我的sql中添加东西,我使用GET方法.
到目前为止,我需要在网站上使用一个表单,但我想添加数据只需浏览它,例如:
这里有http://server.com/add.php?user=some个数据& message =这里的最后数据
我到目前为止尝试使用此代码:
NSURL *add = [NSURL URLWithString:@"http://server.com/ios/add.PHP?user=iPhone App&message=%@",messageBox.text]; [messageVIEw loadRequest:[NSURLRequest requestWithURL:add]];
然而Xcode告诉我:“方法调用的参数太多,预期1,有2”
解决方法 试试这个Nsstring *urlString = @"http://server.com/ios/add.PHP?user=iPhone App&message=";Nsstring *escapedString = [urlString stringByAddingPercentEscapesUsingEnCoding:NSUTF8StringEnCoding];NSURL *add = [NSURL URLWithString:[Nsstring stringWithFormat:@"%@%@",escapedString,messageBox.text]];[messageVIEw loadRequest:[NSURLRequest requestWithURL:add]];
你应该使用Nsstring stringWithFormat:
总结以上是内存溢出为你收集整理的php – iOS Xcode NSURL参数太多了全部内容,希望文章能够帮你解决php – iOS Xcode NSURL参数太多了所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)