XML 解析器中的 UIAlertView didEndElement 未显示

发布于 2024-09-01 21:26:07 字数 290 浏览 2 评论 0原文

我正在开发 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海里的那抹蓝 2024-09-08 21:26:07

如果 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文