[C++] Array modification callback

Is there a way to set a callback for when an array is modified (insert/delete/modify element)

Wrap the array modification in functions that the delegate will also call, and perform all array operations through these functions.

Thanks for the reply! How do I hook it up so that the UI will call these function? I tried looking at he property specifiers page but don’t see anything that looks like it could do this.

I didn’t quite understand you.

Above I talked about something like this:

Sorry, should have been clearer. Let me give some background.

I’m creating a new manager class in C++. It has an array of some definitions. I want to have a callback so when user modifies the array or any of the elements I can do some processing.

Something like this

UPROPERTY()
TArray<FSomeSettings> Settings;

void OnSettingsChanged()
{
    // Do processing here
}

It seems you need this:

UObject::PostEditChangeProperty

Override this in the class you want to track.

Ahh that seems to be it! Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.