President Donald Trump has a prediction: He is going to look at the news headlines on Friday, and they will read that his Thursday press conference was a “ranting and raving” censuring of the press.

And that, he says, would be deeply unfair. “I'm not ranting and raving. I’m having a good time doing it,” Trump said at that press conference.

His press conference was first and foremost aimed at admonishing the press for “fake news,” “illegal leaks,” and a general negative “tone” in stories about him. He might have been having a “good time doing it,” but his angry indictment did have the flavor of a rant.

Trump’s criticism of the media is confusing. He says he wants straight reporting and an honest media, but he got angry when he wasn’t lobbed easy questions. At one point, he admitted there are “real” leaks, yet he calls stories on them “fake news” — a strange paradox.

“The leaks are real; you’re the one that wrote about them and reported them,” Trump told CNN’s Jim Acosta. “The leaks are real. You know what they said. You saw it. The news is fake because so much of the news is fake.”

His conference highlighted a very important aspect of Trump’s understanding of the press: He gets that the relationship is a co-dependent one.

Trump needs the press — and he admitted it. “The public gets it, you know — when I go to rallies, they start screaming at CNN,” Trump said Thursday. “Remember, I used to give you a news conference every time I made a speech, which was like every day. That’s how I won. I won with news conference and probably speeches. I certainly didn’t win by people listening to you people, that’s for sure.”

And yet he must also brand the press as his enemy. Trump wages a war with the media, yet he makes time for a press conference. It’s a tested and successful strategy. During the campaign, Trump would go on air with various networks, and then lambaste them at rallies to cheering crowds. As president, not much has changed. He has a rally scheduled for Saturday, and he will likely repeat the same performance.

All the while, he understands that the media is less liked than he is — at a time when he is deeply unpopular.

After the election, his campaign managers and strategists said they believed free media coverage helped Trump to victory. Trump admits it too. He might be unpredictable in his remarks — even as president — but the media is predictable: They capitalize on the public’s insatiable appetite for Trump stories, and Trump banks on the coverage.

Getting attacked gives him momentum to pull his supporters closer. In that regard, when Trump said, “I don’t mind bad stories,” Thursday, in a way it was one of his more truthful comments.

By attacking CNN, NBC, and ABC, he is trying to preempt negative coverage of his administration — something that worked for him during the primaries and general election.

“Donald Trump understands that with the media world fragmented, people have gone into the echo chambers, and the way to keep your base intact is to go into your echo chambers and deliver the messages,” Purdue University political scientist Josh Scacco said about Trump’s obsession with news.

Trump answers calls from journalists and takes their questions. He knows “how good everybody’s ratings are right now,” and that he does “get good ratings.”

And he has a “good time” doing it.

Watch: Things it's hard to believe the president said