You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*** Terminating app due to uncaught exception 'RLMException', reason: 'Property 'enumType' is declared as 'MyEnum', which is not a supported RLMObject property type. All properties must be primitives, NSString, NSDate, NSData, NSNumber, RLMArray, RLMSet, RLMDictionary, RLMLinkingObjects, RLMDecimal128, RLMObjectId, or subclasses of RLMObject. See https://realm.io/docs/objc/latest/api/Classes/RLMObject.html for more information.'
I suspect it's because I have this init in MyEnum which I can't change (because it's used in other targets I don't have access to). What could be the cause? I spent some time trying to determine the issue and discovered that inside the Realm framework on (BOOL)setTypeFromRawType:(NSString *)rawType in RLMPropertyrawType is @\MyEnum\ which is wrong because all others are some variation of ObjC primitive types.
Here's my enum code:
public enum MyEnum: String, RealmableEnum {
case blue
case red
case unknown
// MARK: - Initialization
public init(rawValue: String) {
let lowercased: String = rawValue.lowercased()
switch lowercased {
case Self.red.rawValue: self = .red
case Self.blue.rawValue: self = .blue
default: self = .unknown
}
}
}
The text was updated successfully, but these errors were encountered:
I'm having a crash that reads:
I suspect it's because I have this
init
inMyEnum
which I can't change (because it's used in other targets I don't have access to). What could be the cause? I spent some time trying to determine the issue and discovered that inside theRealm
framework on(BOOL)setTypeFromRawType:(NSString *)rawType
inRLMProperty
rawType
is@\MyEnum\
which is wrong because all others are some variation of ObjC primitive types.Here's my enum code:
The text was updated successfully, but these errors were encountered: