由于animationDidStop,Apple拒绝了应用程序:完成:context:是非公开API [英] Apple rejected app because of animationDidStop:finished:context: is a non-public api

查看:79
本文介绍了由于animationDidStop,Apple拒绝了应用程序:完成:context:是非公开API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple拒绝了我的应用,因为:

Apple rejected my app because:


3.3.1应用程序只能以Apple规定的方式使用Documented API,不得使用或致电任何私人API。
应用程序必须最初用Objective-C,C,C ++或
JavaScript编写,由iPhone OS WebKit引擎执行,并且只用C,C ++和Objective-C编写的代码
可以编译并直接链接
与Documented API(例如,通过中间翻译或兼容性
图层或工具链接到
文档化API的应用程序。)

3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

您的应用程序中包含的非公共API是 animationDidStop:finished:context:

The non-public API that is included in your application is animationDidStop:finished:context:.

这是我使用上述方法调用的方法:

This is my method in which I am using the call to above mentioned method:

- (void)hideMsg
{

// Slide the view off screen
CGRect frame = self.view.frame;
int retractY;
int retractX;

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.75];

retractY = -190;
retractX = 0;

frame.origin.y = retractY;
frame.origin.x = retractX;
self.view.frame = frame;

//to autorelease the Msg, define stop selector
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];

[UIView commitAnimations];

}

我正在使用此方法显示之后的滑动消息某事件的发生。

I'm using this method to display a sliding message after occurence of certain event.

但是我没有定义这种方法。当我试图找到它时,只能在CAAnimation.h,UIView.h中找到。

But I have nowhere defined this method. When I tried to find it was only found in CAAnimation.h, UIView.h.

有没有人遇到同样的问题?你是怎么解决它的?

Has anybody encountered with the same problem? How did you fix it?

推荐答案

setAnimationDidStopSelector的整点:就是你告诉系统在动画完成时调用你自己的自定义方法。所以,如果你要传递那个选择器,你需要自己在你的类中定义该方法:

The whole point of setAnimationDidStopSelector: is that you are telling the system to call your own custom method when an animation completes. So, if you are going to pass in that selector you need to define that method in your class yourself:

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
{
   // do whatever.
}

请注意 setAnimationDidStopSelector的文档:说你必须使用这种形式的选择器,但实际上你也可以使用像疯狗描述的更短的选择器。但是,最好还是要检查animationID和上下文以及其他项目。

Note the documentation for setAnimationDidStopSelector: says you must use a selector of this form, but in reality you can also use a shorter one like mad-dog described. But, it's better to get the animationID and context and other items to examine.

您需要将该方法添加到代码所在的任何类中,因为您将自己传递给动画委托。

You need to add the method to whatever class that code is in because you are passing self as the animation delegate.

由于某种原因,它们可能还有一个同名的内部UIView方法,这就是为什么你被指控使用未记录的API。

They probably also have an internal UIView method of the same name for some reason, which is why you are being accused of using an undocumented API.

这篇关于由于animationDidStop,Apple拒绝了应用程序:完成:context:是非公开API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆