在我的应用程序中,我使用自定义的NIB来加载我的UITableViewCells。 NIB的文件所有者被设置为这个类是我的View Controller。然后我把UITableViewCell链接到我放在头文件中的IBOutlet。这是所有工作的罚款,直到所有的突然它停止工作,并得到这个错误:奇怪的UITableViewCell加载异常
uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (UITableViewCellContentView)'
我已经追查这个例外[一个NSBundle loadNibNamed:业主:选项:]
static NSString *CellIdentifier = @"SubjectCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"SubjectCell" owner:self options:NULL];
cell = customSubjectCell;
我已经在两个设备和模拟器上尝试了这一点,但都得到相同的错误。我今天下载了新的SDK,我认为这可能是由此造成的。
请注意:
这个问题已经过时,下面的修复是一个临时的解决办法。苹果已经修复了它的SDK,所以如果你有最新版本的SDK,这个不会适用于你。
它只是工作!非常感谢。 – Jirapong 2010-01-28 15:29:34
非常感谢!它开始让我疯狂! (虽然.h文件末尾没有“@end”) – nmondollot 2010-01-29 11:10:43
非常感谢!这工作!但为什么它打破现有的项目? – Mugunth 2010-01-30 11:38:56