如何让 UIBarButtonItem 发送新地址到 UIWebView
我有一个嵌入在导航控制器中的 uiwebview 。我希望能够通过单击 uibarbuttonitem 来更改 uiwebview。有人知道该怎么做吗?
这就是我现在的方法。
-(void)action {
if (item.link) {
self.linkString = item.link;
}
NSString *urlAddress = @"%@/#comments", linkString;
NSURL *address = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:address];
[contentLabel loadRequest:requestObj];
}
I have a uiwebview embedded within a navigation controller. I would like the ability to change the uiwebview by simply clicking a uibarbuttonitem. anyone have any idea how to do that?
heres the method i have right now.
-(void)action {
if (item.link) {
self.linkString = item.link;
}
NSString *urlAddress = @"%@/#comments", linkString;
NSURL *address = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:address];
[contentLabel loadRequest:requestObj];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设置目标选择器或 IBAction 来更改请求对象:
或
You could set the target selector or IBAction to change the request object:
or