-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathHomeController.m
45 lines (36 loc) · 1.22 KB
/
HomeController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// MainController.m
// Flickr Uploader
//
// Created by t on 09/04/05.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <Foundation/NSBundle.h>
#import "HomeController.h"
#import "GameController.h"
@implementation HomeController
- (void) newGame
{
[[self navigationController] pushViewController:[[GameController alloc] init] animated:YES];
}
-(void)loadView
{
[super loadView];
UIView * contentView = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
contentView.backgroundColor = [UIColor whiteColor];
/*
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle: @"New Game"
style:UIBarButtonItemStylePlain
target:self
action:@selector(newGame)]
autorelease];
*/
UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(100.0f, 100.0f, 80.0f, 30.0f)];
[button setTitle:@"New Game" forState:UIControlStateNormal];
[button addTarget:self action:@selector(newGame) forControlEvents:UIControlEventTouchUpInside];
[contentView addSubview:button];
self.view = contentView;
}
@end