and tell me whats wrong, the thing is it worked the first time around,
and it said my code was deprecated, so i changed it to a more recent method and now it doesnt work at all, even if i changed back to my old code.
can someone tell me wants wrong???
and it said my code was deprecated, so i changed it to a more recent method and now it doesnt work at all, even if i changed back to my old code.
can someone tell me wants wrong???
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
// Below is old way, retired method
cell = [[[CustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
// below is the new method, but doesnt work.
// cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell
switch (indexPath.row)
{
case 0:
cell.primaryLabel.text = @"Meeting on iPhone Development";
cell.secondaryLabel.text = @"Sat 10:30";
cell.myImageView.image = [UIImage imageNamed:@"1Star.png"];
break;
case 1:
cell.primaryLabel.text = @"Call With Client";
cell.secondaryLabel.text = @"Planned";
cell.myImageView.image = [UIImage imageNamed:@"I_see_what_you_did_there_super.png"];
break;
case 2:
cell.primaryLabel.text = @"Appointment with Joey";
cell.secondaryLabel.text = @"2 Hours";
cell.myImageView.image = [UIImage imageNamed:@"backgroun2.png"];
break;
default:
break;
}
return cell;
}