diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-30 00:22:01 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-30 00:22:01 +0200 |
commit | 0e8392bbeb57be1111d3cb58efe74b65a7451dbe (patch) | |
tree | f14443d5f0cbabdd3d02895825bdba7906ce09a6 | |
parent | d30b5e487ccbd85deb385a19e12233a9ef9008e2 (diff) |
MLKCharacter: Implement -isEqual:.
-rw-r--r-- | MLKCharacter.h | 2 | ||||
-rw-r--r-- | MLKCharacter.m | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/MLKCharacter.h b/MLKCharacter.h index 220ab18..960a8d8 100644 --- a/MLKCharacter.h +++ b/MLKCharacter.h @@ -40,4 +40,6 @@ +(unichar) uppercaseCharForChar:(unichar)ch; +(unichar) lowercaseCharForChar:(unichar)ch; + +-(BOOL) isEqual:(id)thing; @end diff --git a/MLKCharacter.m b/MLKCharacter.m index 13679bd..a54608a 100644 --- a/MLKCharacter.m +++ b/MLKCharacter.m @@ -68,4 +68,10 @@ { return [[MLKCharacter characterWithUnichar:ch] lowercaseChar]; } + +-(BOOL) isEqual:(id)thing +{ + return ([thing isKindOfClass:[MLKCharacter class]] + && ((MLKCharacter *)thing)->unichar == self->unichar); +} @end |