Hi all…
I need to access a UPROPERTY of a UCLASS through reflection in C++. It shouldn’t present any challenge in itself, something along the lines of:
MyObject->GetClass()->FindPropertyByName(TEXT("MyPropertyName"));
However I’m absolutely certain that there’s a preprocessor macro that provides safe way to reference a property name in C++, that will throw a compile time error in the event that the name changes. Something like this:
FName PropertyName = MAGIC_PROPERTY_MACRO(MyClass::StaticClass(), TEXT("PropertyName"));
Settings->GetClass()->FindPropertyByName(PropertyName);
Can anyone remember what this macro’s called? It’s a bit tricky to find-in-all-files within the source code as I just can’t remember any part of its name! (Tried searching for safe property, things like that - also tried googling for half an hour). Gone through UClass.h to no avail.