【问题标题】:Sound still running after releasing UIWebView释放 UIWebView 后声音仍在运行
【发布时间】:2012-04-02 10:12:53
【问题描述】:

我在 UINavigationController 中推送了一个 UIWebView。这个 webview 将播放声音。 在播放声音的过程中,我接到一个电话,所以我从UINavigationController 弹出UIWebView 并且我也这样做了

myWebView.delegate = nil ;
[myWebView release];
myWebView = nil ;

我也是这样做的

[[NSURLCache sharedURLCache] removeAllCachedResponses];
[[NSURLCache sharedURLCache] removeCachedResponseForRequest:tempAdPlayer.request];
[myWebView loadRequest:nil];

问题是当我从通话中返回时,我发现声音仍在运行。 有人有解决办法吗?

顺便说一句,我在里面放了一些代码

- (void) webViewDidFinishLoad:(UIWebView *)webView1

释放webview后这个功能还在运行

【问题讨论】:

标签: iphone ios xcode uiwebview


【解决方案1】:
myWebView.delegate = nil ;
[myWebView release];
myWebView = nil ;

另外,再次将 web 视图加载到空白 url,您想要停止声音然后停止。

[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];

【讨论】:

  • 在你写之前我已经尝试过这个解决方案:D,我成功了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-11-10
相关资源
最近更新 更多