开发者

Objective-C : pulling value out of NSString

开发者 https://www.devze.com 2023-01-14 08:34 出处:网络
I have a bunch of NSStrings like 开发者_高级运维this.... { \"score\" = 15; \"serial\" = 8; } What is the best way to extract the values out of this string using \"id\" and \"score\"?These are prope

I have a bunch of NSStrings like 开发者_高级运维this....

{
     "score" = 15;
     "serial" = 8;
}

What is the best way to extract the values out of this string using "id" and "score"?


These are property lists in text format. See this answer for how to parse them. You'll get a NSDictionary from which you can pull the values as NSNumbers.

0

精彩评论

暂无评论...
验证码 换一张
取 消