我收到以下错误:
class method '+view' not found return type defaults to 'id'
使用此代码:
[window addSubview:[ButtonsViewController view]];
有人可以帮忙吗?
这是完整的代码:
#import "openURLAppDelegate.h"
#import "ButtonsViewController.h"
#include "ButtonsViewController.h"
@implementation openURLAppDelegate
@synthesize window;
@synthesize ButtonsViewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:[ButtonsViewController view]];
[window makeKeyAndVisible];
}
- (void)dealloc {
[ButtonsViewController release];
[window release];
[super dealloc];
}
@end
答案 0 :(得分:3)
如果view是控制器的UIView,你应该在控制器的实例上调用它,而不是在类上。