Created
March 4, 2011 04:58
-
-
Save rdeguzman/854195 to your computer and use it in GitHub Desktop.
Do we need to release button?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)initButtons{ | |
| NSLog(@"MainViewController.initButtons"); | |
| CGFloat totalHeight = BUTTON_ORIGIN_Y; | |
| for(NSDictionary* section in arraySections){ | |
| NSString* title = [section objectForKey:@"title"]; | |
| UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
| [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown]; | |
| [button setTitle:title forState:UIControlStateNormal]; | |
| button.frame = CGRectMake(BUTTON_ORIGIN_X, totalHeight, BUTTON_WIDTH, BUTTON_HEIGHT); | |
| [self.view addSubview:button]; | |
| totalHeight = totalHeight + BUTTON_HEIGHT + PADDING_VERTICAL; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment