openURL 中的多个字符串。 iPhone SDK
我正在为 iPhone 制作一个 twitter 应用程序,我正在尝试添加一个按钮来打开 Safari,并将用户带到他们的 twitter 主页。我有一个名为用户名的文本字段,因此以下代码不起作用,希望有人能够帮助我。
-(IBAction)viewAccount {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.twitter.com/", username.text]];
}
任何帮助表示赞赏!谢谢你!
I am making a twitter application for iPhone, I am trying to add a button which will open Safari, and take the user to their twitter homepage. I have a textfield called username, so the following code does not work, hopefully someone will be able to help me out.
-(IBAction)viewAccount {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.twitter.com/", username.text]];
}
Any help is appreciated! Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个
Try this
检查您的网址是否正确
编辑:似乎有人比我更快;)
Check if your URL is correct
edit: seems someone was faster than me ;)