new SHeaderRow::Column gets overriden each time and points to the same memory address

SevenOperation
Sun, 19 Jul 2020 08:25:27 +0000
UI

I am trying to get a header row into my displayed table list but somehow the column pointer stays the same every time so that it displays the last column for everything since all point to that location in memory what am I doing wrong?
Code:
TSharedPtr MyListView::generateHeaderRow() { TSharedPtr headerRow = SNew(SHeaderRow); TArray<FString> a = TArray<FString>(); a.Add("ABC"); a.Add("DEF"); a.Add("GHI"); a.Add("JKL"); a.Add("MNO"); a.Add("PQR"); a.Add("STU"); for (int i = 0; i < a.Num(); i++) { const FString columnIdString = FString(*a[i]); SHeaderRow::FColumn column = SHeaderRow::Column(*columnIdString); headerRow->AddColumn(column); } return headerRow; }

Would appreciate any help, thanks in advance.

2 posts - 1 participant