I'm getting No visible @interface for 'NSObject' declares the selector 'viewDidLoad' on the lines:
[super viewDidLoad];
[_viewWeb loadRequest:requestObj];
[super didReceiveMemoryWarning];
UIViewControllerHUB.m
#import "UIViewControllerHUB.h"
@interface UIViewControllerHUB ()
@property (strong, nonatomic) NSMutableArray *subItems;
@end
@implementation UIViewControllerHUB
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *fullURL = @"http://conecode.com";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_viewWeb loadRequest:requestObj];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
UIViewControllerHUB.h
#import <Foundation/Foundation.h>
@interface UIViewControllerHUB : NSObject
@property (strong, nonatomic) IBOutlet UIView *viewWeb;
@end
How can I fix this?
EVERYTHING ABOVE IS NOW RESOLVED.
New error below:
Now getting 'No visible @interface for 'UIView' declares the selector 'loadRequest:' on line
[_viewWeb loadRequest:requestObj];
viewDidLoad
is aUIViewController
method. To fix it, change to inherit from that:In your code 'No visible @interface for
UIView
declares the selector 'loadRequest:' on line why you are getting this error is becuaseloadRequest
is not the method ofUIView
. But in-spite of that it is the method ofUIWebView
. For more refer this UIWebView documentation . So just replaceUIView
toUIWebView
and check//Comment this
//Modify this
Note:- As you have created outlet of
UIView
. So delete the same and drag-drop UIWebView and then reconnect theoutlet
toUIWebView