Hi, I'm trying to use a custom UITableViewCell, and I've placed it in the same nib file as the UITableView controller. For this, the files are: NTItems.h, NTItems.m and NTItems.xib.
I have defined the cell in the header file:
IBOutlet UITableViewCell *cellview;
and I've correctly applied the property: nonatomic, retain so it's there:
@property (nonatomic, retain) IBOutlet UITableViewCell *cellview;
In the m file - I've synthesized the variable device and am using this to get the custom cell:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"cellview";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = self.cellview;
}
Product *aProduct = [appDelegate.products objectAtIndex:indexPath.row];
name.text = aProduct.name;
upc.text = [NSString stringWithFormat:@"UPC%@",aProduct.upc];
price.text = aProduct.pid;
return cell;
}
However, when I load the table, I get this horrible mess:
There should be more than 1 cell showing data as well. It appears that only the last data is showing up right now.