0

I have plist data in a NSString and try to convert this to an array. As the data is only in my NSString object, i cannot use NSArrays arrayWithContentsOfFile method.

Is there a way to get the data to the NSArray without writing it into a temporary file?

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <dict>
...
Mike Nathas
  • 1,247
  • 2
  • 11
  • 29
  • 1
    I am out of my close votes but look at http://stackoverflow.com/questions/1072308/parse-plist-nsstring-into-nsdictionary – Sulthan Mar 26 '16 at 22:47
  • @Sulthan that's not a duplicate, the question asks for arrays and swift, even though it's fairly easy to figure out the answer using the one you've mentioned – fpg1503 Mar 26 '16 at 22:59
  • @fpg1503 That's a bit subjective. I don't think we need separate questions for Obj-C and Swift if we are essentially just ask how to use a framework. – Sulthan Mar 26 '16 at 23:01
  • 1
    @Sulthan I completely agree with you but I understand that for people who code exclusively in Swift it can be a bit hard to use ObjC answers. There are a discussions about that on Meta: [1](http://meta.stackoverflow.com/q/289230/2305521), [2](http://meta.stackoverflow.com/a/285266/2305521). – fpg1503 Mar 26 '16 at 23:08

0 Answers0