如何在UITableViewCell类中添加一些属性?

时间:2013-02-07 09:12:57

标签: class properties

我正在使用UITableViewController和UINavigationController。 我想在tableViewCell上保存一些信息。

UITableViewCell_extensionOf.h文件

#import <UIKit/UIKit.h>

@interface UITableViewCell()

@property(强,非原子)NSDate * onDate;

@end

MasterViewController.m文件

#import“UITableViewCell_extensionOf.h”

...

- (void)viewDidLoad {

.....    UITableViewCell * cell = [[UITableViewCell alloc] init];

cell.onDate = [NSDate date]; //崩溃

}

错误日志: - [UIAccessibilityBundle setOnDate:]:无法识别的选择器发送到实例0x7381b90

如何在UITableViewCell上添加一些额外的属性?我的最后一张卡是子类,它是唯一能让这个工作的方法吗? (实际上,我还没有尝试过子类)

0 个答案:

没有答案