2

I have read that one could use the class dump command line tool to identify private APIs in a project/application. I went through several tutorials but it was not useful to identify the private APIs i have used in my application.

So could someone please help me, by giving me step by step instructions as how to identify private APIs using class dump.

If there is any better, easier way of identifying private APIs, please share it with me.

4
  • If you don't know if you're using private APIs, you're probably not. Also private APIs often have a telltale _ (underscore) in front of their name, I believe. Finally, they do not autocomplete.
    – Keller
    Jan 31, 2012 at 18:10
  • Can you give me an example of how to identify a private API? Are you talking about class name, when you said there is an underscore in front ?
    – shajem
    Jan 31, 2012 at 18:13
  • He is talking about method names. In general, a private API is by definition one that Apple created (as opposed to code that you or a third party wrote) but does not appear in Apple's API documentation. So if you are unsure if a particular class/method/property is private or not, you should look it up in the documentation. If it appears there, it is not private.
    – UIAdam
    Jan 31, 2012 at 19:20
  • i got an error today, and it reads as bool _WebTryThreadLock(bool), 0x2dd030: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... . There's a method in the code that has an __(underscore). SO does that mean that i have used a private api some where in my code ? Help
    – shajem
    Feb 1, 2012 at 16:04

1 Answer 1

1

The only way that you're going to have a private API in your own project is if you put it there yourself (or use some open source code that you didn't realize implemented private APIs). That said, people have ran into private-api related app approval issues even when not really using private apis.

One way to check your application for private API's is by using App Scanner.

http://www.chimpstudios.com/appscanner/

I haven't used it myself but I've had it recommended by colleagues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.