一直以来两个都用,但是没有区分过,基本都是处理字符串。今天整理下异同,以后写代码也能开拓思路,优化算法。 1、setValue /* Send -setObject:forKey: to the receiver, unless the value is nil, in which case send -removeObjectForKey:.*/- (void)setValue:(nul
使用环境和特点 setValue()只能在主线程中调用:多次调用每次都会收到 postValue()可以在任何线程中调用:多次调用,只会收到最后一条更新(当然是在上一条没有发送之前,又收到一条消息时,前一条会被覆盖) 方法分析 setValue() 看官方如何介绍这个方法。 /*** Sets the value. If there are active observers, the v
1 setValue: forKey:的定义 @interface NSMutableDictionary(NSKeyValueCoding) /* Send -setObject:forKey: to the receiver, unless the value is nil, in which case send -removeObject:forKey:. */ - (voi