I’ve to switch a part of my app: I will implement a web view insread of a picture (imageview).
So I tried to make it with the interface builder but there is too many errors so I prefer to use code!
for the pictures, I user those lines :
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]];
self.imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(0,64,320,367);
[self.view addSubview:imageView];
[self.imageView release];
Now, I tried to use this code but nothing’s showed:
@property (nonatomic, retain) IBOutlet UIWebView *webView;
…
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.fr"]]];
[self.view addSubview:webView];
If you know how to make …. would be nice for me,
THANKS!
Declare in your h file:
And also tell to your viewController that you will implement
<UIWebViewDelegate>In viewDidLoad Add:
In dealloc don’t forget to release the webView:
And implement the delegate methods:
And also you need to load an request. You can doit in viewDidLoad after you have added the webView to your view: