unrecognized selector sent to instance

 时间:2026-02-15 08:35:05

1、NSMutableDictionary 类型数据直接使用 = 赋值后,对象类型隐藏着被改变了,变成了 NSDictionaryI 此种类型,此种类型中没有setObject方法,此时再向源数据中插入数据会报错unrecognized selector sent to instance。

2、解决方法:传递数据时可以使用 = 来简化处理直接赋值,在最终保存数据并使用数据时需要重新根据数据来构造 NSMutableDictionary。

- (void)addControls:(NSMutableDictionary*)controls  selectControl:(NSString*)control{

    self.controls = [NSMutableDictionary dictionaryWithDictionary:controls];

    self.hitControl = control;

//    NSLog(@"%@ ---- %@",_controls,_hitControl);

}

  • Server instance is not configured怎么解决
  • Android中的Selector用法
  • sent英文单词什么意思
  • 如何进行汽车SENT总线解码?
  • instanceof关键字
  • 热门搜索
    冰岛旅游多少钱 江苏省旅游地图 香港旅游全攻略 大明山旅游攻略 土耳其旅游地图 旅游团网 法兰克福旅游 湖北省旅游局官网 上海驴妈妈旅游网 安庆旅游景点大全