I created a custom UObject class called UCML which contains a TArray of another custom UObject class called UCMLData. Right before I broadcast my UCML I do a UE_Log to check the number of UCMLData objects and I get the value 3. When I get to the delegate function and I do the same it returns 1. My classes both contain a ToString() function so I call that and, true to form, there is only 1 entry…
Am I doing something wrong here?
EDIT: Count() is just a getter that returns Elements.Num();
//in the .h file
UDELEGATE(BlueprintCallable)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FWFGHttpResponseDelegate, UCML*, Data);
...
public:
UPROPERTY(BlueprintAssignable, Category = "Response Delegates")
FWFGHttpResponseDelegate OnSuccess;
//in the .cpp file
UCML* ServerResponse = NewObject<UCML>(UClass::StaticClass());
ServerResponse->Parse(DecodedHTTPResponse, true);
UE_LOG(
LogTemp, Warning,
TEXT("Data contins this many nodes %d when calling broadcast"),
ServerResponse->Count());
OnSuccess.Broadcast(ServerResponse);
//in my other file .h:
FScriptDelegate CallFetchACategory;
//in.cpp
CallFetchACategory.BindUFunction(this, "FetchACategory");
WUData->OnSuccess.AddUnique(CallFetchACategory);
void UDemoWordPressDataWidget::FetchACategory(UCML* Response)
{
UE_LOG(LogTemp, Warning,
TEXT("Parsed Data contins this many nodes %d in linked function"),
Response->Count());