NSMutableDictionary选择器setObject forkey错误

时间:2013-09-25 19:05:50

标签: objective-c

这是我的代码

NSMutableDictionary* stations = [[NSMutableDictionary alloc] init];
RadioStation* newStation;
newStation = [[RadioStation alloc]
initWithName:@"Star 94 fm" atfrequency:91.4];
[stations setObject:newStation forkey:@"WSTR"];

但我一直收到错误:"no visible @interface" for NSMutableDictionary declares the selector setObject forkey

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

正确的选择器是setObject:forKey:,而不是setObject:forkey: