MoviePlayerAppDelegate.m
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
viewController = [[MoviePlayerViewController alloc] init];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
MoviePlayerViewController.m
-(void)loadView {
//Setup the view.
[self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
[[self view] setBackgroundColor:[UIColor grayColor]];
[[self view] setUserInteractionEnabled:YES];
//Add play button.
playButton = [[UIButton alloc] initWithFrame:CGRectMake(53, 212, 214, 36)];
[playButton setBackgroundImage:[UIImage imageNamed:@"playButton.png"] forState:UIControlStateNormal];
[playButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[[self view] addSubview:playButton];
}
Но почему-то view
не загружается.Я не смог найти ошибку в коде.Пожалуйста, помогите решить эту проблему.Заранее спасибо.