2012-01-30 35 views
0

我用GDataXML解析了XML,但现在我需要在UILabel中显示结果,我正在使用UIViewController。 在此先感谢。在UIViewController中显示解析XML的结果,GDataXML

+0

问题是什么...什么要求在这里,如果u有数据,然后在显示的UILabel,接收以后。 – vishy 2012-01-30 08:32:33

+0

我已经mylabel.text = [data_from_xml attributeForName =标签@“属性”];并且它不起作用 – 2012-01-30 08:42:41

回答

1

首先请检查是否乌拉圭回合得到确切的数据按规定..

我们有方法来检索值:

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

获得字符串对应的值,如

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

打印交叉检查的值

NSlog(@"%@", str); 

然后显示

mylabel.text = str; 
+0

感谢帮助伙计;) – 2012-01-30 09:06:04