摘要:
想让地址不同,但是业务逻辑上可以认为相同的两个对象不重复放入NSSet中,可以通过重写isEqual方法来实现。@interface MFo : NSObject@property (nonatomic, retain) NSString *ii;@end@implementation MFo@synthesize ii;- (BOOL)isEqual:(id)object{return [self.ii isEqualToString:[(MFo*)object ii]];}- (NSUInteger)hash{ return 11111;}@endNSMutableSet *s = [N. 阅读全文