Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Code/TKState.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,20 @@ - (void)encodeWithCoder:(NSCoder *)aCoder
[aCoder encodeObject:self.name forKey:@"name"];
}

# pragma mark - isEqual
- (BOOL)isEqual:(id)other
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When defining the isEqual: method, ou MUST also implement the hash method.

{
if (other == self) {
return YES;
}
if (!other || ![other isKindOfClass:[self class]]) {
return NO;
}
if (![[self name] isEqualToString: [other name]]) {
return NO;
}

return YES;
}

@end