2
我的應用程序在啓動時失敗,我所在的問題下面的代碼:NSInvalidUnarchiveOperationException:不能解碼類(UITableViewCellContentView)的對象
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = @"tblCellView";
TableCellView *cell = (TableCellView *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
cell = [[[TableCellView alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
NSLog(@"this is working----");
[[NSBundle mainBundle] loadNibNamed:@"TableCellView" owner:self options:nil];
NSLog(@"this is not working----");
cell = tblCell;
}
return cell;
}
但是我在做什麼錯?
的錯誤:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (UITableViewCellContentView)'
感謝您的幫助!
嘗試再次保存'TableCellView.nib'嗎? – kennytm 2010-01-31 06:19:36
同樣的錯誤。 : - / – phx 2010-01-31 13:01:52