【发布时间】:2013-12-22 02:57:38
【问题描述】:
我得到 No visible @interface for 'NSObject' 声明选择器 'viewDidLoad' on 行:
[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
我该如何解决这个问题?
以上所有问题现已解决。
以下新错误:
现在得到 'UIView' 没有可见的@interface 声明选择器 'loadRequest:' 上线
[_viewWeb loadRequest:requestObj];
【问题讨论】:
-
如果您有新问题,请提出新问题;不要编辑你的旧的。在这种情况下,您可能需要先查看您的代码并在其他问题中寻找类似的错误。
-
您的代码是正确的。唯一的问题在于您的 LoadRequest 方法,它不是 UIView 方法,而是 UIWebView。我已经更新了答案,请关注。
标签: objective-c uiviewcontroller nsobject