How to check if an attribute exists for a particular entity at runtime. I will implement a property named dateAddStamp, but not all entities have this attribute. This class will serve as a base for other entity's classes... So I want to check at runtime If I can call [self setPrimitiveValue:xxx forKey:xxx] or not... Thanks.
in swift
let hasFoo = myObject.entity.propertiesByName.keys.contains("foo")
BOOL hasFoo = [[myObject.entity propertiesByName] objectForKey:@"foo"] != nil;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With