0

我收到以下错误:

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
4

1 回答 1

3

如果 view 是你的控制器的 UIView 你应该在你的控制器的实例上而不是在类上调用它。

于 2012-04-28T12:40:45.283 回答