iphone SDK + WebView

iphone SDKでWebサイトの表示方法をメモ




Controller.h

#import <UIKit/UIKit.h>

@interface webViewController : UIViewController 
{
    IBOutlet UIWebView *webView;
}

- (IBAction)Click;

@end


IBOutlet作成後、デザイン上のUIWebViewと関連づけ
IBAction作成後、デザイン上のボタンに関連づけ


Controller.m

- (IBAction)Click
{
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://d.hatena.ne.jp/tama_blog/"]]];
}


ビルド後実行
GOボタン押下