那是您的应用程序委托的应用程序加载方法。
在那里,您可能想要创建一个自定义视图控制器的实例,并将其作为 rootViewController 分配给您的应用程序委托 didFinishLoading。应该有这样一行:
// app delegate .h file
#import "CustomViewController.h"
@interface
{
...
CustomViewController *myCustomVC;
...
}
@property (nonatomic, retain) CustomViewController *myCustomVC;
// app delegate .m file
@implementation AppDelegate
@synthesize myCustomVC;
-(BOOL)application:(UIApplication*)application didFinishLoadingWithOptions:(NSDictionary *)launchOptions
{
...
myCustomerVC = [[CustomViewController alloc] init];
[self.window setRootViewController:myCustomVC];
...
}
然后在自定义视图控制器的 viewDidLoad 方法中,您可以将其作为测试:
// custom view controller .m file
-(void)viewDidLoad
{
self.view.backgroundColor = [UIColor redColor];
}