How to unwrap the content value from XML in Objective-C

吃可爱长大的小学妹 提交于 2019-12-02 23:19:01

问题


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);
}

The content that I receive from XML are:

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

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

Any help appreciate.


回答1:


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



来源:https://stackoverflow.com/questions/44850293/how-to-unwrap-the-content-value-from-xml-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!