Created
November 19, 2012 19:57
-
-
Save sgoodwin/4113451 to your computer and use it in GitHub Desktop.
A new object emerges!
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
@protocol RWSSection | |
- (NSUInteger)numberOfObjects; | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRow:(NSInteger)row; | |
@end | |
@interface RWSStaticSection : NSObject<RWSSection> | |
@property(nonatomic, readonly) NSArray *items; | |
@end | |
@implementation RWSSection | |
- (id)init | |
{ | |
self = [super init]; | |
if(self){ | |
_items = @[@"Help I'm trapped in the debugger!", @"No no, save me instead!"]; | |
} | |
return self; | |
} | |
- (NSUInteger)numberOfObjects | |
{ | |
return 2u; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRow:(NSInteger)row | |
{ | |
static NSString *staticIdentifier = @"staticSectionCell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:staticIdentifier]; | |
cell.textLabel.text = self.items[row]; | |
cell.detailLabel.text = @"I'm a static row!"; | |
return cell; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment