나는 UITableVIew
입니다. 이제는 내 자신을 만들었습니다 UITableViewCell
. 그러나 내 테이블이 나타나지 않으면 아무 것도 표시되지 않습니다. 그러나 셀은 여전히 선택 가능하며 DetailView
을 엽니 다. 어떤 명령을 잊어 버렸습니까?UITableViewCell이 테이블에 나타나지 않습니다.
//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입니다 : 당신이 줄
cell. VerwaltungInformation *selectedFormel = [listOfFormularies objectAtIndex:indexPath.row];
도 댓글을 달았습니다
#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
제대로 연결 했습니까? datasource 및 tableView 대리인을 연결 했습니까? 그렇다면 - (NSInteger) tableView : (UITableView *) tableView numberOfRowsInSection : (NSInteger) 섹션에 중단 점을 입력하고 반환 값을 확인하십시오. (행의 수량이어야합니다) – Stas
표가 작동하지만 테이블을 추가하면 세포 내가 tablecells에 서명을 얻을 것이다. 나는 cellin을 rootviecontroller.h 또는 다른 곳에서 선언해야합니까? MainTableCell.h 만 가져 왔고 다른 작업은 수행하지 않았기 때문에 ... – Daniel05