关闭 UIAlertView
我将应用程序内购买放入我的应用程序中,当用户点击按钮时,购买就会开始。因此,基本上,他们点击按钮,然后根据互联网连接的速度,他们可能会等待长达十秒钟,直到出现新的警报视图,询问他们是否愿意购买该产品。由于没有任何反应,用户可能会多次点击该按钮,然后会出现多个购买警报视图。此外,这可能会被用户视为应用程序错误。归根结底,这是一个问题。
我想要一个警报视图,当用户点击购买按钮时,出现一个旋转轮,显示“正在加载...”。现在我的问题是,当出现新的警报视图询问用户是否要购买该产品时,如何消除该警告?
if ([UIAlertView alloc] that says: @"whatever Apple's alert view says")
{
//dismiss the "Loading..." alert view here
}
我怀疑这会起作用,所以任何意见都会受到赞赏。谢谢!
I put an in app purchase into my app, and when the user taps a button, the purchase is started. So basically, they tap the button, and then depending on the speed on their Internet connection, they could be waiting for up to ten seconds until a new alert view comes up asking if they would like to buy the product. The user will probably tap the button multiple times since nothing came up, and then multiple purchase alert views will come up. Additionally, this could maybe be seen by the user as an app bug. In the end, this is a problem.
I want an alert view to come up with a spinning wheel that says "Loading..." when the users taps the buy button. Now my problem is, how do I get that to dismiss when the new alert view comes up asking the user if they want to buy the product?
if ([UIAlertView alloc] that says: @"whatever Apple's alert view says")
{
//dismiss the "Loading..." alert view here
}
I doubt that would work, so any input is appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要有权访问该警报视图。你可以这样做。在应用程序委托中创建一个alertview实例变量,当您想要显示加载时,初始化该实例变量分配给您的属性,当您想要关闭时,只需调用
在appDelegate的方法中编写这段代码。希望你能明白。如果没有让我知道,我将在此处发布示例代码。
You need to have access to that alertview. You can do this. Create a alertview instance var in app delegate and when you want to show loading initialize that instance var assign to your property and when you want to dismiss just call
Write this piece of code in a method in appDelegate. Hope you get the idea. If not let me know I'll post the sample code here.