how to fix my phone samsung galaxy ace. ui is not working

A

AC Question

there's a prompt that always appears and it says "unfortunately UI has stopped working". I tried to turn it off and remove the battery for hours. then put it back again and turned it on. i even cleared the system cache and formatted the phone by pressing the power button+home key+ Volume up. I donno what else to do. pls help