WebView を介してその特定の方向を開くために、Web アドレスである関数に文字列を渡す際に問題があります。
-(IBAction)toWeb:(NSString*)web_direction {
UIViewController *webViewController = [[[UIViewController alloc] init] autorelease];
UIWebView *uiWebView = [[[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)] autorelease];
[uiWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:web_direction]]];
[webViewController.view addSubview: uiWebView];
webViewController.title = @"web bar";
[self.navigationController pushViewController:webViewController animated:YES];
}
次を使用して、MKanotation を介してその関数を呼び出したい:
NSString *direction = @"http://www.google.com";
[btnDetails addTarget:self action:@selector(toWeb:direction) forControlEvents:UIControlEventTouchUpInside];
しかし、アプリがクラッシュします。それについて何か考えはありますか?