I am using XCode 7 and iOS 9 and I added a UIWebView to my storyboard scene
and did the following:
Connected it to my header file and added the UIWebViewDelegate:
@interface LHPurchaseOrderDetail : UIViewController<UIWebViewDelegate>
@property (strong, nonatomic) IBOutlet UIWebView *viewWeb;
and then did this in my .m file:
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"WebView : %@",_viewWeb);
[_viewWeb setDelegate:self];
NSString *fullURL = [NSString stringWithFormat:@"http://www.google.com"];
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_viewWeb loadRequest:requestObj];
}
and that NSLog returns this:
WebView : <UIWebView: 0x7a7e85a0; frame = (0 0; 240 128); autoresize = RM+BM; layer = <CALayer: 0x7a7d8d90>>
I have these two methods:
- (void)webViewDidFinishLoad:(UIWebView *)webViewIn {
NSLog(@"web view did finish loading");
}
and
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
NSLog(@"Error : %@",error);
}
Error does not show up in my log, but web view did finish loading did
But the UIWebView does not appear. This is inside an Detail View Controller, this is a contraints issue with my storyboard, I don't know anything about contraints so you would have to be specific. What Am I doing wrong? Why isnt my UIWebView Appearing?
Here is an image of my storyboard: