It's a tough question because I've visited both cities and loved them.
When it comes to architecture, I love Madrid more, but Barca also has a lot of amazing places.
Food is good in both cities, but the atmosphere is Barcelona is better.
I'd choose it for sure, but think about visiting Madrid too!