I am facing a weird crash after updating the Xcode to 10.2. I have an Objective-C class method as below
@interface Car: NSObject
+ (NSDictionary<NSString *, Class> *) carMapping;
@end
which returns dictionary of type NSDictionary<NSString *, Class>
as below
@implementation Car
+ (NSDictionary<NSString *, Class> *) carMapping {
return @{
@"BMW": [BMWCar class],
@"Mercedes": [MercedesCar class],
@"Toyota": [ToyotaCar class],
@"Tesla": [TeslaCar class]
};
}
@end
I use this Objective-C method in Swift as
let carMapping = Car.carMapping()
print(carMapping)
which works perfectly fine with Xcode 10.1.
But after updating the Xcode to 10.2, app crashes saying Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
in line 1. I do not have any clue.
I do not have control over the class Car
. How would I handle the situation?