Skip to content

Commit

Permalink
Fixing leaks and minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne committed Dec 11, 2009
1 parent ae086c1 commit f1d6517
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Demo/Classes/EHTabBarDemoAppDelegate.m
Expand Up @@ -17,18 +17,18 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {


//Set up basic UIView
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
UIView *v = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
v.backgroundColor = [UIColor grayColor];

//Instanciate EHTabBar
EHTabBar *tabBar = [[EHTabBar alloc] initWithFrame:CGRectMake(0, 20, 320, 65)];
EHTabBar *tabBar = [[[EHTabBar alloc] initWithFrame:CGRectMake(0, 20, 320, 65)] autorelease];
tabBar.delegate = self;
tabBar.tabWidth = 100.0;
tabBar.selectedTextColor = [UIColor whiteColor];
tabBar.deselectedTextColor = [UIColor darkGrayColor];

//Add tabs with a title
[tabBar setTabs:[NSArray arrayWithObjects:@"Test", @"Hello",nil]];
[tabBar setTabs:[NSArray arrayWithObjects:@"Test", @"Hello", nil]];
[v addSubview:tabBar];

[window addSubview:v];
Expand All @@ -38,11 +38,10 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
}


- (void)tabBar:(EHTabBar*)tabBar tabSelected:(NSInteger)selectedIndex;
{
- (void)tabBar:(EHTabBar*)tabBar tabSelected:(NSInteger)selectedIndex {
UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Tab %d was selected on EHTabBar %@",selectedIndex,tabBar] message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];
[errorAlert release];
[errorAlert release];
}

- (void)dealloc {
Expand Down

0 comments on commit f1d6517

Please sign in to comment.