Was in Capetown a year ago and the city itself felt generally safe (with the usual common sense precautions in any city). The townships would be another matter.
Not been to Jo'Burg personally, but, from second hand accounts, I would expect it to feel more threatening from this perspective.