(iPhone 应用程序)错误:函数“URLWithString:”的参数太多
我正在尝试格式化 URL 字符串,但它说参数太多。我的代码如下:
-(IBAction)tweetRandom {
//NSLog(@"CALLED");
test = 100;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://twitter.com/%i", test]]; // problem line
}
有人知道如何格式化 URL 吗?希望有一个名为 URLWithFormat
的东西,但它不存在。
I'm trying to format a URL string however it's saying there are too many arguments. My code is below:
-(IBAction)tweetRandom {
//NSLog(@"CALLED");
test = 100;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://twitter.com/%i", test]]; // problem line
}
Anyone know how to format the URL? Was hoping there was something by the name of URLWithFormat
but it doesn't exist.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要像这样使用
stringWithFormat:
:You need to use
stringWithFormat:
like this: