自定义TableView问题

时间:2011-04-17 07:37:03

标签: ios4

我有自定义单元格设计的.xib文件。使用某些控件,例如UILabelUIButton。 BeginingCell.xib的代码如下:

BeginingCell.h

@interface BeginingCell : UITableViewCell {
    IBOutlet UILabel *SectionTitle;
    IBOutlet UILabel *Option1;
    IBOutlet UILabel *Option2;
    IBOutlet UILabel *Opiton3;
    IBOutlet UILabel *Opiton4;

    IBOutlet UIButton *button1;
    IBOutlet UIButton *button2;
    IBOutlet UIButton *button3;
    IBOutlet UIButton *button4;

    IBOutlet UIButton *ansBtn1;
    IBOutlet UIButton *ansBtn2;
    IBOutlet UIButton *ansBtn3;
    IBOutlet UIButton *ansBtn4;

    IBOutlet UIImageView *myImageView; //Here it is

    NSMutableArray *myArray;
}

///Properties
@property(nonatomic,retain)IBOutlet UILabel *SectionTitle;

@property(nonatomic,retain)IBOutlet UILabel *Option1;
@property(nonatomic,retain)IBOutlet UILabel *Option2;
@property(nonatomic,retain)IBOutlet UILabel *Option3;
@property(nonatomic,retain)IBOutlet UILabel *Option4;

@property(nonatomic,retain)IBOutlet UIButton *button1;
@property(nonatomic,retain)IBOutlet UIButton *button2;
@property(nonatomic,retain)IBOutlet UIButton *button3;
@property(nonatomic,retain)IBOutlet UIButton *button4;

@property(nonatomic,retain)IBOutlet UIButton *ansBtn1;
@property(nonatomic,retain)IBOutlet UIButton *ansBtn2;
@property(nonatomic,retain)IBOutlet UIButton *ansBtn3;
@property(nonatomic,retain)IBOutlet UIButton *ansBtn4;

@property(nonatomic,retain)IBOutlet UIImageView *myImageView; //Here it is

@property(nonatomic,retain)NSMutableArray *myArray;
@end

AND实现代码如下:

@implementation BeginingCell

@synthesize myArray,SectionTitle,Option1,Option2,Option3,Option4,button1,button2,button3,button4,myArray,myImageView,ansBtn1,ansBtn2,ansBtn3,ansBtn4;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code.
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {    
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state.
}

/*
- (void)dealloc {
    [super dealloc];
}
*/

@end

我想将此.xib加载到tableView控制器中。任何人都可以告诉我如何将beginingCell.xib添加到我的tableView控制器中?

1 个答案:

答案 0 :(得分:0)

我认为您正在尝试this

你会发现自己使用搜索