C++ Array of Scene Components help Please

Hey guys, I am pretty new to C++ and just can’t seem to figure this one out. The project compiles fine in Xcode but the Editor freezes while opening .

Here is my code

.h file -
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Interaction)
TArray> Sockets;

.cpp file -
Sockets.Add(ObjectInitializer.CreateDefaultSubobject(this, TEXT(“Socket1”)));

I’ve tried a couple variations in the cpp file but nothing has worked. Any help appreciated.

Thanks

Try this instead:

USceneComponent *SceneComponent = NewObject<USceneComponent>(this);
SceneComponent->AttachTo(RootComponent);
SceneComponent->RegisterComponent();

Sockets.Add(SceneComponent);