I have an app that dynamically loads classes using the following code ...
Class cls = [[NSBundle mainBundle] classNamed:s];
This worked since iOS4 but recently failing about 50% on the iOS Simulator, but some reports on stackoverflow hint it hits real devices, too.
Does anyone know a workaround?
LittleNapoleon* dummy = [LittleNapoleon class];
NSLog(@"%@",NSStringFromClass(dummy));
Class cls = [[NSBundle mainBundle] classNamed:s];
NSAssert(cls != nil, @"classNamed: %@ returned nil!", s);
This fails even if the class is successfully loaded in the code! Output ...
LittleNapoleon
'classNamed: LittleNapoleon returned nil!'
References: http://stackoverflow.com/questions/39794424/classnamed-in-ios-10-on-ipad-air-2