我只想打开提供URL的网页。我的代码是:在Objective-C中使用变量
void openURL(char const *message)
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:message]];
}
而我得到的错误是:
cannot initialize a parameter of type 'NSString *' with an lvalue of type 'const char *'
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:message]];
我不熟悉Objective-C的,也没有学习它。我只需要在一个项目中使用这个简单的代码。
第一个解决方案工作。非常感谢你。 – rootpanthera 2014-09-03 10:05:46