This repository has been archived by the owner on Jun 15, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainViewController.m
81 lines (62 loc) · 2.14 KB
/
MainViewController.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// MainViewController.m
// CelShader
//
// Created by Sebastian Gamboa on 13-11-08.
// Copyright 2008 SagMor. All rights reserved.
//
#import "MainViewController.h"
#import "ModelSelectionController.h"
#import "OptionsViewController.h"
#import "CelShadingViewController.h"
@implementation MainViewController
// Override initWithNibName:bundle: to load the view using a nib file then perform additional customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
modelSelectionView = nil;
optionsView = nil;
cellShadingView = nil;
}
return self;
}
// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
self.title = @"CelShader";
[super viewDidLoad];
self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
[modelSelectionView release];
modelSelectionView = nil;
[optionsView release];
optionsView = nil;
[cellShadingView release];
cellShadingView = nil;
}
- (void)dealloc {
[super dealloc];
}
- (IBAction)selectModel:(id)sender{
if (!modelSelectionView) {
modelSelectionView = [[ModelSelectionController alloc] initWithStyle:UITableViewStyleGrouped];
}
[[self navigationController] pushViewController:modelSelectionView animated:YES];
}
- (IBAction)setOptions:(id)sender{
if (!optionsView) {
optionsView = [[OptionsViewController alloc] initWithNibName:@"OptionsView" bundle:nil];
}
[[self navigationController] pushViewController:optionsView animated:YES];
}
- (IBAction)showModel:(id)sender{
[cellShadingView release];
cellShadingView = [[CelShadingViewController alloc] initWithNibName:@"CelShadingView" bundle:nil];
[[self navigationController] pushViewController:cellShadingView animated:YES];
}
@end