【发布时间】:2015-06-21 08:25:58
【问题描述】:
我正在为应用程序进行应用内购买编码,连接 iTunes 商店时会显示一个活动指示器。当连接正常完成时,Activity Indicator 可以停止,但以下情况除外:
有两个“取消”按钮: 1. 选择购买时,系统会显示一个iTunes商店登录视图,带有“取消”按钮。 2.如果输入密码继续,如果产品之前购买过,可以返回另一个“取消”按钮。
由于活动指示器在步骤 1 开始动画,如果按下两个“取消”按钮中的任何一个将完成该过程,但活动指示器仍在旋转,因为我无法捕捉到取消按钮。
我尝试了“alertView”和“actionSheet”来获取 buttonIndex,但它们在自定义 alertView 中始终有效。
func alertView(View: UIAlertView!, clickedButtonAtIndex buttonIndex: Int){
println(buttonIndex)
}
func actionSheet(actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) {
println(buttonIndex)
}
任何建议将不胜感激。
【问题讨论】:
-
您可以使用 applicationDidbecomeActive 通知来检测购买对话框的关闭