Skip to content

Instantly share code, notes, and snippets.

@hlung
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlung/cabeec6d5f1a9090c2a8 to your computer and use it in GitHub Desktop.
Save hlung/cabeec6d5f1a9090c2a8 to your computer and use it in GitHub Desktop.
Calling `-isKindOfClass` on a class object doesn't raise any warning and will give wrong comparison results. We have to use `+isSubclassOfClass:` instead.
+ (NSString*)levelName {
if ([self isSubclassOfClass:[FGRoom class]]) {
return @"Room";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment