error C2248: 'UDataTable::RowMap'.

error C2248: ‘UDataTable::RowMap’: cannot access protected member declared in class ‘UDataTable’. Anyone can explain what is the problem? I did it many times but no it doesnt work in 4.21 version. I have been writing like this:



USTRUCT(BlueprintType, Blueprintable)
struct HIDESEEK_API FCameraModeTableRow : public FTableRowBase
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    float TargetFOV;
}

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class TEST_API UCameraTest: public UActorComponent
{
    GENERATED_BODY()

public:    

    UCameraProcessor();

protected:

    virtual void BeginPlay() override;
    float CameraTargetFOV;

    virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;

private:
    UDataTable* CameraModeTable;


in cpp


    for (auto RowIt : CameraModeTable->RowMap)
    {
        FCameraModeTableRow* Row = (FCameraModeTableRow*)(RowIt.Value);
        if (Row->State == State)
        {
            CameraTargetFOV = Row->TargetFOV;
           ///...
        }
    }

They changed things to be more encapsulated in 4.21.

Rather than accessing it directly through “CameraModeTable->RowMap”, you simply need to call “GetRowMap()”



for (auto RowIt : CameraModeTable->GetRowMap())
{
// ...
}