简体   繁体   English

混淆:(2.5)使用非公共API的应用程序将被拒绝

[英]confused about: (2.5) Apps that use non-public APIs will be rejected

I submit my App to App store, and after review it was rejected. 我将我的应用程序提交到App商店,并在审核后被拒绝。 Reason from Apple was: Apple的理由是:


2.5: Apps that use non-public APIs will be rejected 2.5:使用非公共API的应用程序将被拒绝

*We found that your app uses one or more non-public APIs, which is not in compliance with the App Store Review Guidelines. *我们发现您的应用使用了一个或多个非公开API,这些API不符合App Store审核指南。 The use of non-public APIs is not permissible because it can lead to a poor user experience should these APIs change. 不允许使用非公共API,因为如果这些API发生变化,可能会导致糟糕的用户体验。 We found the following non-public APIs in your app: 我们在您的应用中发现了以下非公开API:

dateWithCalendarFormat:timeZone: dateWithCalendarFormat:时区:

hourOfDay HOUROFDAY

minuteOfHour minuteOfHour

secondOfMinute secondOfMinute

setNavigationBar: setNavigationBar:

If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your application being flagged in future submissions. 如果您在源代码中定义了与上述API相同名称的方法,我们建议您更改方法名称,以便它们不再与Apple的私有API发生冲突,以避免在将来的提交中标记您的应用程序。

Additionally, one or more of the above-mentioned APIs may reside in a static library included with your application. 此外,上述API中的一个或多个可能位于应用程序附带的静态库中。 If you do not have access to the library's source, you may be able to search the compiled binary using "strings" or "otool" command line tools. 如果您无权访问库的源,则可以使用“strings”或“otool”命令行工具搜索已编译的二进制文件。 The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. “strings”工具可以输出库调用的方法列表,“otool -ov”将输出Objective-C类结构及其定义的方法。 These techniques can help you narrow down where the problematic code resides.* 这些技术可以帮助您缩小有问题的代码所在的位置。*


But, problem is that I did not declare or define any of methods with the names as the above-mentioned APIs. 但问题是我没有声明或定义任何名称为上述API的方法。 And I did not used any custom library. 我没有使用任何自定义库。 It is quite simple application (planer) and I used only: UIKit, CoreData, AVFoundation, Foundation and EventKit. 这是非常简单的应用程序(刨床),我只使用:UIKit,CoreData,AVFoundation,Foundation和EventKit。

I send message to Apple yesterday, but still no answer. 我昨天给苹果发了消息,但仍然没有回答。

Any ideas? 有任何想法吗?

You said in the comments above you used 你在上面的评论中说过你用的

 [[[datePicker date] dateWithCalendarFormat:nil timeZone:nil] hourOfDay]

Now, [datePicker date] returns an NSDate , whose documentation shows there's no public methods named dateWithCalendarFormat:timezone: nor hourOfDay etc. 现在, [datePicker date]返回一个NSDate ,其文档显示没有名为dateWithCalendarFormat:timezone:的公共方法dateWithCalendarFormat:timezone:还是hourOfDay等。

So, you can't just use them. 所以,你不能只使用它们。

As for setNavigationBar: , the property navigationBar of UINavigationController is a readonly property, as the documentation says. 对于setNavigationBar: , UINavigationController的属性navigationBar是一个只读属性,正如文档所述。 Therefore you can't set it. 因此您无法设置它。

When you compile your app, the compiler should have issued lots of warning about it, saying that the selector was not found, etc. You should always regard those warnings as errors, and eliminate them. 编译应用程序时,编译器应该发出很多关于它的警告,说没有找到选择器等。你应该始终将这些警告视为错误,并消除它们。 This way you can avoid rejection after submission. 这样您就可以避免在提交后拒绝。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM