Created
December 27, 2010 04:59
-
-
Save kwylez/755876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* properties are (int) numberOfViews, (int) secondsForRotation, (MyCustomObject) myCustomObject | |
*/ | |
- (BOOL)isEqualToCustomWidget:(CustomWidget *)aCustomWidget { | |
if (self == aCustomWidget) | |
return YES; | |
if (numberOfViews != [aCustomWidget numberOfViews]) | |
return NO; | |
if (secondsForRotation != [aCustomWidget secondsForRotation]) | |
return NO; | |
if (![myCustomObject isEqual:[aCustomWidget myCustomObject]]) | |
return YES; | |
} | |
-(BOOL)isEqual:(id)other { | |
if(other == self) | |
return YES; | |
if(!other || ![other isKindOfClass:[self class]]) | |
return NO; | |
return [self isEqualToCustomWidget:other]; | |
} | |
- (unsigned)hash { | |
return numberOfViews ^ secondsForRotation ^ [myCustomObject hash]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment