Open yusuke024 opened 9 years ago
On Fri, Apr 24, 2015 at 1:03 PM, Sikhapol Saijit notifications@github.com wrote:
This portion of the code in FIFirstViewController https://github.com/smartVong/4square/blob/master/FourSquareInfo/FIFirstViewController.m#L70-L75 looks a little bit unfitted.
(FIFirstTableViewCell)tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath )indexPath { NSString cellIdentifier = @"FirstViewCell";
FIFirstTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if(!cell) { [self.tableView registerNib:[UINib nibWithNibName:@"FIFirstTableViewCell" bundle:nil] forCellReuseIdentifier:cellIdentifier]; cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier]; } ... }
Try to understand how reusable cell pool work in UITableView and modify this code.
Hint: Cell registration is in the wrong place. And look at another dequeue method: dequeueReusableCellWithIdentifier:forIndexPath: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/dequeueReusableCellWithIdentifier:forIndexPath: to see how it's different from dequeueReusableCellWithIdentifier: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/dequeueReusableCellWithIdentifier: .
If you have any questions, please feel free to leave the comments. You've been doing a good job so far. Please bare with us [image: :wink:]
— Reply to this email directly or view it on GitHub https://github.com/smartVong/4square/issues/3.
This portion of the code in FIFirstViewController looks a little bit unfitted.
Try to understand how reusable cell pool work in
UITableView
and modify this code.Hint: Cell registration is in the wrong place. And look at another dequeue method:
dequeueReusableCellWithIdentifier:forIndexPath:
to see how it's different fromdequeueReusableCellWithIdentifier:
.If you have any questions, please feel free to leave the comments. You've been doing a good job so far. Please bare with us :wink:
PS. Can you fix this in a PR?