在 UIViewController、GDataXML 中显示解析 XML 的结果

发布于 2024-12-29 11:25:04 字数 78 浏览 3 评论 0原文

我用 GDataXML 解析了 XML,但现在我需要在 UILabel 中显示结果,我正在使用 UIViewController。 提前致谢。

i parsed a XML with GDataXML but now i need display the result in a UILabel, i'm working with a UIViewController.
Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

伴我心暖 2025-01-05 11:25:04

首先检查您是否按照要求获取了准确的数据。

我们有检索值的方法:

- (NSString*) stringValueForAttribute: (NSString*)attributeName;
- (BOOL) boolValueForAttribute: (NSString*)attributeName;
- (NSInteger) integerValueForAttribute: (NSString*)attributeName;

获取字符串中的相应值,

NSString* str = [data_from_xml stringValueForAttribute:@"attribute"];

打印该值进行交叉检查

NSlog(@"%@", str);

然后显示在标签上

mylabel.text = str;

First check wether u r getting the exact data as per requirement..

we have the methods to retrieve the value:

- (NSString*) stringValueForAttribute: (NSString*)attributeName;
- (BOOL) boolValueForAttribute: (NSString*)attributeName;
- (NSInteger) integerValueForAttribute: (NSString*)attributeName;

get the corresponding value in a string, as

NSString* str = [data_from_xml stringValueForAttribute:@"attribute"];

print the value for cross check

NSlog(@"%@", str);

then display on label

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