Parse plist in Dart - dart

I am creating a level editor in Dart for my cocos2d-x game and I have to parse animations stored plist files. Has anyone created or found a library for parsing plists in Dart? If not, I guess I will have to write my own.

I am not aware of any plist parser, but you could convert the plist to JSON (https://stackoverflow.com/a/10991695/1919627) then parse using the dart:convert library:
Map parsedData = JSON.decode(mapAsJson);

Eight years later — a very useful package called plist_parser is available on pub.dev. It is based on the xml package to parse plist data from strings, files or binaries.

Related

Parse protobuf file in iOS applicaiton

I am getting data file in the format of .proto, I am confronting this type of parsing for the first time. Could you please suggest how we can parse .proto file in the iOS app. I am very new with a protobuf file.
I am able to handle protoBuf formate data. I have used Swift Protobuf swift library for it. This is really a great library, it has awesome documentation. I am adding a reference here. https://github.com/apple/swift-protobuf

How to generate an XML document in iOS using objective-c

I want to generate an XML document in iOS. My primary goal is to generate it using inbuilt classes/libraries. I researched a lot and I found that NSXMLElement, NSXMLDocument etc are used to generate XML in OS X but not in iOS (correct me if I'm wrong about this). I found some of the third party libraries like GDataXML, APXML etc which generates the XMLDocument as per my needs. But, I'm trying hard to achieve the same using inbuilt classes (if any). BTW, I do not want the strings to be appended manually to create XML.
I'm not expecting a complete code which does the generation. Any help/suggestion on any inbuilt classes would be appreciated.
Thanks in advance.
You're right -- you need to look for a 3rd party solution for XML writing in iOS. For parsing, there is NSXMLParser.

Phone directory in iOS

I am creating a IOS phone directory app. I am trying to download a XML file from a url. This XML file will then be used to populate the directory app with phone numbers, names and identifications of all the people in the directory. I'm new to IOS development and I'm looking for any information or assistance on where to get started on how to parse the XML file.
What is included with Cocoa is NSXMLParser, and you can download the source code imageMap. There are also other third party libraries such as TouchXML and TBXML. Although in my experience TouchXML has some memory leaks issues that can create a lot of problems. And the one that has given me the fastest results is TBXML by far.
You can find a detailed article on all the available third-party parsers available here: Best xml parser for your app
TBXML is the way to go IMO. I have a complete code sample if you need it. If you post the structure of that XML file, I can modify the sample to fit your needs.
If you are creating the webserver manually, then I would look into using JSON instead of XML. It's a bit easier to work with. If you need to use XML, the NSXML parser class works pretty well. Here is a good tutorial: http://www.xcode-tutorials.com/parsing-xml-files/
Or you could check out chapter 21 I believe of the big nerd ranch iPhone programming book for a more detailed explination.
Good Luck!

Get localized core data strings list on runtime?

I know i can generate a .strings file with "genstrings" in terminal.
In my case many of the strings are coming from core data and they are not literally written on xcode.
is there a way to generate the list of the strings on runtime?
Thanks
Shani

How to write to an XML file from iOS?

I am developing an app for iPad, and I need to modify several attributes in a XML file at runtime.
I found the class NSXMLDocument. But I haven't been able to import it to my project.
Is this class not available for iPhone/iPad development?
Is there some other approach I can consider?
I read about libxml library. Is it my answer or there is a better approach?
NSXMLDocument is MacOS X Cocoa only. You have available on iPhone NSXMLParser, and several external libraries built on libxml2 - TouchXML, KissXML and a couple of others.
Note that KissXML supports writing XML.
Other XML libraries that have been suggested include the XML support from Google Data and VTD-XML.
You are looking for a DOM XML parser, which is best for modification of XML documents. See for example this tutorial - without mapping to and from Model Objects - use the XPath.

Resources