I want to create an array of structs with several items, including a reference to a ui object.
Without the ui object the construction works. With the object it doesn’t (likely a memory allocation issue).
while it might be working now but you could end up with an issue in the future. you should null terminate the strings. you may have to increase the array length by one in order to be able to do that. if the longest string is 20 then you would set the array to have a length of 21.
It seems like your ui_Button uninitilized during compile time. But lvgl initilize objects in runtime. So your lv_obj_t* button; at best case scenario initilized as NULL, at worst - with random number. Try to equate button fields after relevant call of lv_obj_create()