class-dump
provides a list of all the methods that are defined by an executable or framework (well, more or less; there are ways for methods to exist that don't show up, but class-dump
is going to get most of them). It is possible to compare the output of class-dump
of the Apple frameworks to a scan of the public headers to find a list of private methods, and then scan your code for those private methods. That's a lot of work, and you'd definitely need a tool for it.
There's at least one tool out there that says it helps called App-Scanner. I have not tried it. I'm not aware of any other tools in this space.
That said, of course, it's kind of weird to be using them by accident. You typically have to have done some trickery to call them without generating warnings (and of course, you're not shipping with warnings because that would be insane; if you are, fix your warnings and you'll find the private APIs). If you've suppressed unknown selector warnings in some places, or you've used categories to declare Apple private methods, then look for those and get rid of them. There had to have been a point in time when you said "I'm doing this thing that is not public and I'm tricking the compiler into letting me do it." It generally can't happen by accident.