Each object has
-(BOOL) isequal: ( ID ) Object This method
For example:
/** * Common to compare two Hwemotion objects (address) is the same * * @param other hwemotion Object * * @return Yes: On behalf of 2 objects is the same, no: 2 objects are not the same*/-(BOOL) IsEqual: (Hwemotion *) other{//if (self = = other) {//return YES;//} else {//return NO;// } //Hwlog (@ "%@--isequal---%@", self.chs, Other.chs); //nsstring *str1 = @ "Jack";//nsstring *str2 = [NSString stringwithformat:@ "Jack"];// //str1 = = str2//No//[str1 isequal:str2];//NO to determine whether the address is consistent//[str1 ISEQUALTOSTRING:STR2]//YES to determine whether the content is consistent return[Self.chs IsEqualToString:other.chs] | |[Self.code IsEqualToString:other.code];}
When calling
Removeobject: When this method deletes an object, IsEqual is called by default : This method is judged
-(BOOL) IsEqual: (ID) object