Last active
December 11, 2015 06:29
-
-
Save rscarvalho/4559721 to your computer and use it in GitHub Desktop.
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
| @interface WPViewController () | |
| @property (nonatomic, strong) NSArray *posts; | |
| @end |
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
| @implementation WPViewController | |
| /* ... */ | |
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| self.posts = @[@"Post #1", @"Post #2", @"Post #3"]; | |
| } | |
| - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
| { | |
| return self.posts.count; | |
| } | |
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"post"]; | |
| cell.textLabel.text = self.posts[indexPath.row]; | |
| return cell; | |
| } | |
| /* ... */ | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment