forked from rileytestut/N64iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TabBar.m
69 lines (56 loc) · 1.02 KB
/
TabBar.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
#import "SOApplication.h"
BOOL blocking = NO;
@implementation TabBar
-(void)resetButton
{
blocking = YES;
[self setSelectedItem:[self.items objectAtIndex:0]];
}
- (void)didMoveToWindow
{
[self setSelectedItem:[self.items objectAtIndex:0]];
}
/*
- (void)didMoveToWindowNowPlaying
{
[self setSelectedItem:[self.items objectAtIndex:3]];
}
*/
/*
- (void)didMoveToWindowBookmarks
{
[self setSelectedItem:[self.items objectAtIndex:1]];
}
*/
- (void)didMoveToWindowSaveStates
{
[self setSelectedItem:[self.items objectAtIndex:2]];
}
- (void)setSelectedItem:(id)item {
[super setSelectedItem:item];
int itemIndex = [self.items indexOfObject:self.selectedItem];
if (!blocking)
{
if (itemIndex == 0)
{
[SOApp.delegate switchToBrowse];
}
else if (itemIndex == 1)
{
[SOApp.delegate switchToRecent];
}
else if (itemIndex == 2)
{
[SOApp.delegate switchToOptions];
}
else
{
[SOApp.delegate switchToSaveStates];
}
}
blocking = NO;
}
- (void)dealloc {
[super dealloc];
}
@end