我想将数组添加到 nsdictionary 中的键。例如每个键是一个问题,每个问题都有多个答案。
问题1 = [答案1],[答案2],[答案3];
问题2 = [答案1],[答案2],[答案3];
使用下面的代码,我得到No Visible @interface for NSDictionary 声明选择器'setObject:forKey:'
//answers
_surveyAnswers1 = [[NSMutableDictionary alloc] init];
NSArray *myArrayAnswers1 = [NSArray arrayWithObjects:@"One",@"Two", nil];
NSArray *myArrayAnswers2 = [NSArray arrayWithObjects:@"Three",@"Four", nil];
[_surveyAnswers1 setObject:myArrayAnswers1 forKey:@"FirstKey"];
[_surveyAnswers1 setObject:myArrayAnswers2 forKey:@"SecondKey"];
将数组添加到 NSDictionary 中的键的正确方法是什么?