I've been to Barcelona quite a few times , and quite happily (foolishly?) walked around by myself up till about midnight or so.
However there were two occasions when put me on guard a bit, both times just off LAS RAMBLAS, once in a pretty square with a fountain and lots of tourists, so minding my own business then the oddball that always hangs out looking for tourists to tap approaches and tries to make conversation, he may just have been the friendly type but I just ignored him and walked off (hands in pockets!).
The other was just to the south side of las ramblas where it goes from touristy shops to a more run down seedy type of area, no trouble but the state of the area showed that it may be home to some more shady types, so probably best avoided.
The other thing is that driving around Barcelona can be a pain without a navigator, I drove round for what seemed like hours looking for the "Sagrada", even tried following the signs but the one way system defeated me so I found a bar for a drink instead.