开发者

UIApplication.SharedApplication.TerminateWithSuccess is not there

Why isn't the TerminateWithSuccess method of the SharedApplication implemented in MonoTouch? How can I invoke it? or even better, how ca开发者_开发技巧n I programmatically close the application?


terminateWithSuccess is private API, which is why MonoTouch does not surface it. You should still be able to call it by using a Selector.

        Selector s = new Selector("terminateWithSuccess");
        UIApplication.SharedApplication.PerformSelector(s, UIApplication.SharedApplication, 0)


FWIW- I received this last week- Looks like the time is UP for this method...

Thank you for submitting your update to xxxx to the App Store. During our review of your application we found it is using private APIs, which is in violation of the iPhone Developer Program License Agreement section 3.3.1; "3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs." While your application has not been rejected, it would be appropriate to resolve this issue in your next update.
The following non-public APIs are included in your application:
terminateWithSuccess
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 with future submissions. Please resolve this issue in your next update to xxx.


After posting the question i figured it out, but Matt beat me to it. Here's another way:

UIApplication.SharedApplication.PerformSelector(new Selector("terminateWithSuccess"), null, 0f);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜