如何在Objective-C中从XML解包内容值 [英] How to unwrap the content value from XML in Objective-C

查看:98
本文介绍了如何在Objective-C中从XML解包内容值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在XML文件中正确接收了调试中的值.

I'm receiving correctly in XML file the value in debug.

- (void)connectionDidFinishLoading:(NSURLConnection *)connection 
{
    LogDebug(TAG_SETTINGS, @"Provisioning file downloaded, %lu bytes", (unsigned long)[self.provisioningData length]);

    NSString *content = [[NSString alloc] initWithData:self.provisioningData encoding:NSUTF8StringEncoding];
    LogDebug(TAG_SETTINGS, @"Downloaded data: \n%@", content);

    NSLog(@"Steve note:Here is the content of provisioning profile%@",content);
}

我从XML接收的内容是:

The content that I receive from XML are:

<settings>
  <setting name='Conference Number' value='#159' />
</settings>

我需要的是value='#159',我不知道如何解包并获取价值.

What I need is value='#159', I don't know how to unwrap it and take the value.

任何帮助表示赞赏.

推荐答案

实际上,不需要解包,value ='#159'已经解包了,所以当我使用内容时,它已经给了我'# 159'.

Actually, no need to unwrap it, the value='#159' already unwrap it, so when I use the content, it already give me the '#159'.

这篇关于如何在Objective-C中从XML解包内容值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆