Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 320
无夜之星辰 Avatar asked Oct 18 '22 01:10

无夜之星辰


1 Answers

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.

like image 173
Rob Napier Avatar answered Nov 02 '22 23:11

Rob Napier