NSDictionary setValue: forKey:的坑

setValue: forKey是NSMutableDictionary的一个扩展方法,当传入的value为nil时为调用removeObjectForKey:方法,对于NSDictionary来说没有removeObjectForKey:
方法,所以会报错 setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key xxx

你可能感兴趣的:(NSDictionary setValue: forKey:的坑)