Search code examples
iosobjective-capp-storeappstore-approvalios10

My app had been refused because of non-public APIs


There is what Apple feedback: Your app uses or references the following non-public APIs:

  • init:

The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

what confused me most is that "init:",I mean really,what wrong with "init:"?We can not use "init:"?What's more,when we use non-public APIs is there any warming in Xcode?How can I find these non-public APIs?


Solution

  • You really shouldn't be using anything with the name init:. That would be an init method with one parameter, but no explanation about what that parameter is. For example:

    - (instancetype) init:(NSString *)string;
    

    That would always be an incorrect name. The correct name would be:

    - (instancetype) initWithName:(NSString *)string;
    

    (or initWithTitle: or initWithSomeOtherThingButSomething:)

    So I would first search for init:, and that should be easily fixable. If you don't actually have any methods with that name, then this is possibly a bug in Apple's tool and you will need to discuss it with Apple.