Using 5.2, how can I get the MetaData of a property?

The idea is someone creates a blueprint with some properties and functions that can be called through an external interface. Yes, I know there are already mechanisms to do this, but there are reasons I am doing it differently. So the author of the BP would put functions and variables they want to give access to into the “UI” category. The following code works and compiles just fine for UE5.3, but I am currently working in 5.2 (not my choice), and the line GetMetaData throws a compile error.

In fact, looking up the documentation, it’s not listed as a function available in 5.2 for FProperty (but is for 5.3). But that ignores inheritance… I’m not a great C++ programmer, I’m just getting by (I was over 20 years ago, most of my development since then has been other languages, and C++ has changed dramatically), but isn’t FProperty a subclass of FField? And FField DOES have a GetMetaData function, so I’m not getting what’s wrong.

bool UMyLibrary::GetProperties(UObject* Target, TArray<FString>& properties)
{
	bool result = false;
	TArray<FString> props;
	props.Empty();
	for (TFieldIterator<FProperty> prop(Target->GetClass()); prop; ++prop)
	{
		FString name = prop->GetName();
		FString type = prop->GetNameCPP();
		FString category = prop->GetMetaData(FName("Category")); // won't work in 5.2
		props.Add(name + "," + type + "," + category);
		result = true;
	} /* */
	properties = props;
	return result;
}

And what is the error message ?

The error was that FProperty didn’t have a method named “GetMetaData,” but for whatever reason, this is now working.

I’d originally written this for 5.3, but had to roll back; when I was working in 5.3 it worked just fine, but I got the error for 5.2; I noticed the 5.3 docs say GetMetaData is a member of FProperty, but in 5.2 it isn’t - but it is a member of FField, so should be accessible.

I think this was just VS getting confused (and therefore confusing me). I don’t know what changed, but it compiles OK now.