Created
November 19, 2012 19:22
-
-
Save sgoodwin/4113057 to your computer and use it in GitHub Desktop.
UITableViewDataSource method with switches, but with symbols.
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
typedef enum { | |
RWSSectionInfo, | |
RWSSectionDynamic, | |
RWSSectionCount | |
}RWSSection; | |
const NSInteger kNumberOfInfoRows = 2; | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
RWSSection sectionIndex = section; | |
switch(sectionIndex){ | |
case RWSSectionInfo: | |
return kNumberOfInfoRows; | |
break; | |
case RWSSectionDynamic: | |
return [self.items count]; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment