Im working on to customize my cell like below
By debugging, I know that line 4-5 are not reached at all
Therefore, I cant create my own cell
According to apple documentation
Therefore, in my situation, the table view does return a reusable cell object... Where it comes from then...
Have any one experienced this issue before. Please help thanks.
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
1. static NSString *CellIdentifier = @"reusedCell";
2. DetailCell *cell = (DetailCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Customize the cell of each row from table
3. if ( cell == nil ) {
4. NSLog(@" MY CELL IS NIL");
5. cell = [[DetailCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
6.}
7. else
8. NSLog(@" MY CELL IS NOT NIL");
}
By debugging, I know that line 4-5 are not reached at all
Code:
MY CELL IS NOT NIL
According to apple documentation
Code:
Typically, the first thing the data source should do is send dequeueReusableCellWithIdentifier: to the table view, passing in a reuse-identifier string. [B]If the table view does not return a reusable cell object, the data source creates one, assigning the object a reuse identifier in the final parameter of initWithStyle:reuseIdentifier:[/B]
Have any one experienced this issue before. Please help thanks.
Last edited: