Created
November 7, 2015 14:36
-
-
Save Seasons7/2eb1578e680e0a4f45c0 to your computer and use it in GitHub Desktop.
CCBReader.m
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
Class class = NSClassFromString(className); | |
if (!class) | |
{ | |
// Class was not found. Maybe it's a Swift class? | |
// See http://stackoverflow.com/questions/24030814/swift-language-nsclassfromstring | |
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; | |
NSString *classStringName = [NSString stringWithFormat:@"_TtC%lu%@%lu%@", (unsigned long)appName.length, appName, (unsigned long)className.length, className]; | |
class = NSClassFromString(classStringName); | |
} | |
if (!class) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment