简体   繁体   English

将NSMutableData转换为NSMutableDictionary?

[英]converting NSMutableData to NSMutableDictionary?

i am accumulating data from NSMutableDictionary to NSMutabledata like 我正在将数据从NSMutableDictionary累积到NSMutabledata

    NSMutableData *data = [receivedData objectForKey:@"tag1"];

and also 并且

    data  = [receivedData objectForKey:@"tag2"];

after this one , how can i get data for @"tag2" only from NSMutableData? 在此之后,如何仅从NSMutableData获取@“ tag2”的数据?

 NSMutableData tag2Data = [Data forKey:@"tag2"]; 

is not working? 不管用?

I'm unsure exactly what you are trying to do here, but it doesn't look like you are using the proper class. 我不确定您要在这里做什么,但是看起来您使用的是不正确的类。 If you check the class reference from Apple there is a link to a great code example of getting a string out of an NSMutableData object, but the only way to access the data inside it is using getBytes. 如果您查看Apple的类引用,那么有一个很棒的代码示例的链接,该代码示例从NSMutableData对象中获取字符串,但是访问其中的数据的唯一方法是使用getBytes。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM