У меня есть UITableVIew
. Теперь я сделал свой собственный UITableViewCell
. Но если моя таблица появляется, ничего не отображается. Однако ячейки по-прежнему можно выбрать и открыть DetailView
. Какую команду я забыл?
//Customize the appearance of table view cells.
-(UITableViewCell *)tableView: (UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"MainTableCell";
MainTableCell *cell = (MainTableCell*)[tableView dequeueReusableCellWithIdentifier:Cel lIdentifier];
if (cell == nil) {
cell = [[[MainTableCell alloc] initWithStyle:UITableViewCellStyleDef ault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
VerwaltungInformation *selectedFormel = [listOfFormularies objectAtIndex:indexPath.row];
cell.FormelNameLabel.text = selectedFormel.nameFormel;
return cell;
}
Должен ли я добавлять специальные вещи? Если кому-то нужно больше кода - скажите, пожалуйста.
Вот мой MainTableCell.h:
import <UIKit/UIKit.h>
@interface MainTableCell : UITableViewCell {
UILabel *FormelNameLabel;
UILabel *ErklaerungVerfuegbarLabel;
UILabel *BeispielVerfuegbarLabel;
UILabel *RechnerVerfuegbarLabel;
}
@property (nonatomic, retain) IBOutlet UILabel *FormelNameLabel;
@property (nonatomic, retain) IBOutlet UILabel *ErklaerungVerfuegbarLabel;
@property (nonatomic, retain) IBOutlet UILabel *BeispielVerfuegbarLabel;
@property (nonatomic, retain) IBOutlet UILabel *RechnerVerfuegbarLabel;`
@end
А вот мой MainTableCell.m:
#import "MainTableCell.h"
@implementation MainTableCell
@synthesize FormelNameLabel;`
@synthesize ErklaerungVerfuegbarLabel;
@synthesize BeispielVerfuegbarLabel;
@synthesize RechnerVerfuegbarLabel;`
- (void)dealloc {
[FormelNameLabel release];
[ErklaerungVerfuegbarLabel release];
[BeispielVerfuegbarLabel release];
[RechnerVerfuegbarLabel release];
[super dealloc];
}
@end