相关疑难解决方法(0)

类不符合键值编码

我知道这个错误的意思,但我真的很挣扎,我需要别人的帮助:

2010-09-21 15:03:11.562 Stocks[5605:207] *** Terminating app due to uncaught 
exception 'NSUnknownKeyException', reason: '[<NSObject 0x499fb20> 
setValue:forUndefinedKey:]: this class is not key value coding-compliant 
for the key actionText.'
Run Code Online (Sandbox Code Playgroud)

这里有我的代码:

AlertCell.h

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>


@interface AlertCell : UITableViewCell {
    IBOutlet UILabel *actionText;
}

@property (retain, nonatomic) UILabel *actionText;

@end
Run Code Online (Sandbox Code Playgroud)

AlertCell.m

@implementation AlertCell
@synthesize actionText;

- (void)dealloc {
    [actionText release];
    [super dealloc];
}

@end
Run Code Online (Sandbox Code Playgroud)

问题发生在那里:

- (UITableViewCell *)tableView:(UITableView *)tableView 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    AlertCell *cell = 
      (AlertCell …
Run Code Online (Sandbox Code Playgroud)

iphone key uitableview

67
推荐指数
4
解决办法
6万
查看次数

UITableViewCell Title和Subtitle -iOS之间的空格

如何在UITableViewCell中增加标题和副标题之间的空间?

在此输入图像描述

objective-c uitableview ios

6
推荐指数
1
解决办法
2236
查看次数

标签 统计

uitableview ×2

ios ×1

iphone ×1

key ×1

objective-c ×1