XML 解析器中的 UIAlertView didEndElement 未显示
我正在开发 iPhone 应用程序。应用程序使用 .net Web 服务执行操作并返回“成功”或“失败”状态。
我在 xml 解析器 didEndElement 中获得此状态,就像
if( [elementName isEqualToString:@"OperationStatusResult"])
{
}
我试图在 didEndElement 内状态失败但未显示时显示 UIAlert 视图一样。我在这里缺少什么吗?
任何帮助将不胜感激。
谢谢
I am working on an iphone application. Application uses .net web service to perform an operation and return the status either "Success" or "Failure".
I am getting this status in xml parser didEndElement like
if( [elementName isEqualToString:@"OperationStatusResult"])
{
}
I am trying to show an UIAlert view if status is failure within didEndElement but it does not show. Is there anything I am missing here.
Any help would be greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 didEndElement 内的状态为失败,我试图显示 UIAlert 视图,但它没有显示。我在这里缺少什么吗?
如果您在后台线程中运行 XML 解析,请确保 在主线程上执行 UI 更新。
将
UIAlertView
代码放入视图控制器中的选择器中,并使用-performSelectorOnMainThread...
方法在状态失败时触发警报视图。I am trying to show an UIAlert view if status is failure within didEndElement but it does not show. Is there anything I am missing here.
If you are running the XML parsing in a background thread, make sure you perform the UI update on the main thread.
Put your
UIAlertView
code into a selector in your view controller and use the-performSelectorOnMainThread...
method to fire off the alert view, if the status fails.