CHICAGO — Donald J. Trump’s feelings about Chicago couldn’t have been clearer. He loved the place.

It was 2004, and Mr. Trump, then a developer and reality show star, was waging a charm campaign here. He raved about Chicago’s “stunning” skyline and admired its architectural ingenuity as he proposed adding his own building to the mix. It was a “great city,” he said, right up there with his hometown, New York. Had Twitter existed at the time, Mr. Trump’s hashtag might have read #mykindoftown.

Oh, how his views have changed. In recent months, Mr. Trump has repeatedly — obsessively, in the view of some — commented on Chicago’s street violence in interviews, debates and off-hour social media outbursts. “Chicago needs help!” he wrote on Twitter recently, after lamenting the city’s “carnage” in an earlier missive and vowing to “send in the feds” to save the day. On Tuesday, after meeting with police union leaders at the White House, Mr. Trump once again took note of this city’s violence, saying “I always ask, ‘What’s going on in Chicago?’”

Politics could be partly to blame for Mr. Trump’s apparent change of heart. Chicago is Democratic to its core. It is where Barack Obama got his political start. And it is an easy foil when describing, as Mr. Trump does quite a bit, how dire urban America has become.

But personal pique may also be an important factor when it comes to Mr. Trump’s relationship with the city.