开发者

Send itms: to safari nstead of webview

开发者 https://www.devze.com 2023-01-30 01:43 出处:网络
I have the following code: Webview *web = [[Webview alloc] initWithNibName:@\"Webview\" bundle:nil]; [web setModalPresentationStyle:UIModalTransitionStyle开发者_运维知识库CrossDissolve];

I have the following code:

  Webview *web = [[Webview alloc] initWithNibName:@"Webview" bundle:nil];
  [web setModalPresentationStyle:UIModalTransitionStyle开发者_运维知识库CrossDissolve];
  [self presentModalViewController:web animated:YES];
  [web loadThisURL:[NSURL URLWithString:self.urlString]];
  [web release];

I'd like to wrap that around an if statement, so that if urlString starts itms: then it should send the url to safari instead of webview. How would I write the if statement to check if it starts with itms?

Many Thanks!


Look at the documentation for the NSString method hasPrefix:.

0

精彩评论

暂无评论...
验证码 换一张
取 消