#import <UIKit/UIKit.h>
@interface VocaTableCell : UITableViewCell
{
UILabel *vocaLabel;
}
@property (nonatomic, retain) IBOutlet UILabel *vocaLabel;
@end
#import "VocaTableCell.h"
@implementation VocaTableCell
@synthesize vocaLabel;
- (void)dealloc {
[vocaLabel release];
[super dealloc];
}
@end
Ваш код неправильный. ниже код см. плз. Я исправил.
Ниже приведен код ссылки Befoe, вы правильно делаете customTableCell? ниже список проверьте плз.
Существует несколько способов создания custtomTablecell.
Моя манера очень популярна.
CustomTabelCell Владельца файла должен быть NSObject .
(Очень важное значение по умолчанию: Maybe UITableCell. Необходимо изменить владельца файла. NSObject (NSObject означает тип id!))
CustomTableCell связывает класс объекта с вашим классом CustomTableCell.
Ссылка на ссылку Outlets не является владельцем файла, должна быть Вашей прямой ссылкой на CustomTableCell.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Custom";
Custom *cell = (Custom *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell)
{
UINib *nib = [UINib nibWithNibName:@"Custom" bundle:nil];
NSArray *arr = [nib instantiateWithOwner:nil options:nil];
cell = [arr objectAtIndex:0];
}
cell.textLabel.text =[arr objectAtIndex:indexPath.row];
}