タイプ NSPopUpButtonCell の NSTableView でセルをバインドすると、エラーが発生しました
[<NSTableColumn > valueForUndefinedKey:]: this class is not key value coding-compliant for the key value.
現実には、NSPopUpButtonCell の内容を文字列として単純に調べているだけです。
しかし、私は変わりました
NSString *name;
に
NSObject *name;
NSPopUpButtonCell列を表示するNSTableViewにコンテンツを表示しようとすると、アプリケーションがロードされましたがクラッシュしました
ERROR: unrecognized selector sent to instance
UNBOUND セルがある場合、エラーは発生しません。さらに、セルのタイプが NSTextFieldCell の場合、問題はなく、代わりに NSString クラスを使用できます。
これは、エラーで確認できることから、正しいビットをすべてに接続することであると推測しています。では、ポップアップセルにポップアップボタンを表示し、選択したセルの値を実際の配列に保存するにはどうすればよいですか?
ありがとう
//------------------------------------------------
//my.h
//------------------------------------------------
@interface theItemsInArrayC : NSObject {
@private
NSString *name;
int age;
}
@property int age;
@property (copy) NSString *name;
@end
@interface mybigList : NSObject {
@private
NSMutableArray *theItems;
}
@property (copy) NSMutableArray *theItems;
@end
//------------------------------------------------
と
//------------------------------------------------
//my.m
//------------------------------------------------
@implementation theItemsInArrayC
@synthesize name;
@synthesize age;
- (id)init
{
self = [super init];
if (self) {
age = 19;
name = @"Another Name";
}
return self;
}
@end
@implementation mybigList
@synthesize theItems;
- (id)init
{
self = [super init];
if (self) {
theItems = [[NSMutableArray alloc] init];
}
return self;
}
@end
//------------------------------------------------