iPhone - 加载活动指示器
我知道我的问题,但找不到解决方案。当按下按钮时,它会告诉 UIActivityIndicatorView 开始 Aminate 并从 XML feed 中检索数据。我遇到的问题是它在开始加载器动画之前运行整个事件,因此加载器在检索数据之前永远不会旋转。如何启动加载程序的动画,然后在启动后继续从 XML 提要获取数据?
-(IBAction)getXMLData {
[loader startAnimating];
[self retrieveXML];
}
.
. code
. more code
.
-(void)retrieveXMLEnded {
[loader stopAnimating];
}
I am aware of my problem but cannot find a solution. When the button is pressed it tells the UIActivityIndicatorView to startAminating and also retrieve data from a XML feed. Problem I am having is it runs the whole event before starting the animating of the loader, so the loader never spins before the data is retrieved. How can I start the loader's animation and then once it has started continue with getting data from the XML feed?
-(IBAction)getXMLData {
[loader startAnimating];
[self retrieveXML];
}
.
. code
. more code
.
-(void)retrieveXMLEnded {
[loader stopAnimating];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在其他线程中启动动画
Strart animation in other thread