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];
In your code 'No visible @interface for UIView
declares the selector 'loadRequest:' on line why you are getting this error is becuase loadRequest
is not the method of UIView
. But in-spite of that it is the method of UIWebView
. For more refer this UIWebView documentation . So just replace UIView
to UIWebView
and check
//Comment this
//@property (strong, nonatomic) IBOutlet UIView *viewWeb;
//Modify this
@property (strong, nonatomic) IBOutlet UIWebView *viewWeb;
Note:- As you have created outlet of UIView
. So delete the same and drag-drop UIWebView and then reconnect the outlet
to UIWebView
viewDidLoad
is a UIViewController
method. To fix it, change to inherit from that:
#import <Foundation/Foundation.h>
@interface UIViewControllerHUB : UIViewController
@property (strong, nonatomic) IBOutlet UIView *viewWeb;
@end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With