我有以下代码:
Webview *web = [[Webview alloc] initWithNibName:@"Webview" bundle:nil];
[web setModalPresentationStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:web animated:YES];
[web loadThisURL:[NSURL URLWithString:self.urlString]];
[web release];我想把它封装在if语句中,这样如果urlString启动itms:那么它应该把url发送到safari而不是webview。我如何编写if语句来检查它是否以itms开头?
非常感谢!
发布于 2010-12-08 21:05:22
查看NSString方法hasPrefix:的文档。
https://stackoverflow.com/questions/4387603
复制相似问题