1

Recently I have get a reject from Apple because a use of a private API. I don't know exactly what is a private API nor an undocumented method. Could someone explain me what is an undocumented method and a private API? I'm really confused with that...

Follow up:

  • What is exactly the "official documentation"? Can I use some frameworks and classes made by thirds such as the Amazon one?
Kara
  • 6,115
  • 16
  • 50
  • 57
VICTORGS3
  • 203
  • 3
  • 13

2 Answers2

10

A private API or undocumented method is any object or method that is not part of the official documentation. In Objective C, and some other languages, it is relatively easy to find the list of methods (messages) that an object supports as well as the objects underlying the framework. (For example, just go into the debugger and look at the view hierarchy. You will likely see several view objects that don't exist in the documentation.) Sometimes you will even see instructions on how to use these methods and objects on the web.

One example that leaps to mind is -UIWindow _autolayoutTrace, I use it all the time when debugging autolayout, but it isn't documented and the leading underscore is a hint that you shouldn't be using it. That's fine for debugging, but if I shipped code that used that method it would be certain to be rejected.

But Apple specifically scans for these undocumented methods as part of the App Store review process and rejects apps that use them. This is because Apple might change how these undocumented methods work at any time. If your app was dependent on one of these hidden classes or methods your app might break when Apple released a new version of the SDK that changed this behavior.

David Ogren
  • 4,396
  • 1
  • 19
  • 29
  • First of all thank you for replying but now I have a dubt: what is exactly the "official documentation"? Can I use some frameworks and classes made by thirds such as the Amazon one? – VICTORGS3 Apr 08 '13 at 23:11
  • 2
    Any third party libraries have to play by the same rules. If a library/framework used undocumented APIs, that would cause any apps that use those frameworks to be rejected. Of course, that would make those frameworks useless (with some edge case exceptions) so you can be fairly certain that any major framework would fix that quickly. (See some of the related questions in the sidebar for some examples of this, notably Three20 ) – David Ogren Apr 09 '13 at 00:48
2

There's a set of functionalities that Apple uses internally but are not publicly available for developers.

Any usage of such APIs will result in a rejection of the application by Apple.

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235