私はバインディングを使用する初心者です。テーブル ビューとアレイ コントローラーを備えたサンプル アプリケーションの開発を開始しました。私のデータは文字列の配列です。
インターフェイスビルダーを使用して必要なすべてのバインディングを行った後、配列に文字列を表示できます。しかし、テーブル ビューの任意の行を編集しようとすると、次の例外が発生します。
なぜこれが来るのか分かりません。
次のコードを使用しました-
.h ファイル
輸入
interface AppDelegate : NSObject <NSApplicationDelegate>
property (assign) IBOutlet NSWindow *window;
property (nonatomic,weak) IBOutlet NSTableView *tableView;
property (nonatomic,strong) NSMutableArray *arrayContents;
end
.m ファイル
implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { }
-(id)init
{
self = [super init] ;
if (nil!=self)
{
_arrayContents = [[NSMutableArray alloc] init];
[_arrayContents addObject:@"asdasdasd"];
[_arrayContents addObject:@"asdasdasdsasdc"];
}
return self;
}
end
これを解決して間違いを指摘するのを手伝ってくれる人はいますか? サンクス。
2013-06-26 11:15:56.055 サンプル[4643:303] キー入力の処理中に例外が検出されました。2013-06-26 11:15:56.068 sample[4643:303] オブジェクト asdasdasdsasdc のキー パスの値の設定エラー (バインドされたオブジェクト識別子から: (null)): [<__NSCFConstantString 0x100002a18> setValue:forUndefinedKey:]: このクラスはkey のキー値コーディングに準拠していません。