Announcement

Collapse
No announcement yet.

error C2248: 'UDataTable::RowMap'.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:

    Code:
    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
    Code:
        for (auto RowIt : CameraModeTable->RowMap)
        {
            FCameraModeTableRow* Row = (FCameraModeTableRow*)(RowIt.Value);
            if (Row->State == State)
            {
                CameraTargetFOV = Row->TargetFOV;
               ///...
            }
        }
    Last edited by Yungkee; 01-20-2019, 05:55 AM.

    #2
    They changed things to be more encapsulated in 4.21.

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

    Code:
    for (auto RowIt : CameraModeTable->GetRowMap())
    {
    // ...
    }
    Able Ability System - A high performance, robust ability system for UE4. Now Available!

    Comment

    Working...
    X