iOS 跳转浏览器问题

duoduo_333 2015-03-04 01:11:24
NSLog(@"%@",self.jobNetArr[indexPath.row]);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.jobNetArr[indexPath.row]]];
无法跳转啊.


然后我i用打印的出来的地址
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://gxt.bosshr.com/1_2271_show.html"]];
却可以跳转.中括号,标点符号我都检查过了,没问题.上面却跳转不成.

有木有遇到这样的问题的,求解啊..
...全文
199 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ReyZhang 2015-03-04
  • 打赏
  • 举报
回复
你怎么总是能碰到这么多奇怪的问题,呵呵。 如果请求的地址没错,且NSURL对象能被成功创建,打开safari是没问题的。
Bannings 2015-03-04
  • 打赏
  • 举报
回复
把url拿出来试试: NSURL *url = [NSURL URLWithString:self.jobNetArr[indexPath.row]; [[UIApplication sharedApplication] openURL:url]; 反正对UIApplication来说都是一个NSURL对象,没理由不行
duoduo_333 2015-03-04
  • 打赏
  • 举报
回复
引用 1 楼 shine511511 的回复:
nsstring * str = [self.jobNetArr[indexPath.row] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; 试试。。。
不行
恐男 2015-03-04
  • 打赏
  • 举报
回复
nsstring * str = [self.jobNetArr[indexPath.row] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; 试试。。。

29,030

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧