문제

I want to bundle some pre-loaded data with an iOS app. I have some raw data but that's edited in the spreadsheet. Is there any way to transfer this data into property list (.plist) format without manually inputting it?

도움이 되었습니까?

해결책

Export 2 columns from the spreadsheet in XML format, then programatically read the XML file and use the NSPropertyListSerialization class to de-serialize the raw XML data:

NSData *pListDataAsXML = [NSData dataWithContentsOfFile:@"xmlFileName.xml"];
id pListData = (id)[NSPropertyListSerialization propertyListFromData:pListDataAsXML
                                                    mutabilityOption:NSPropertyListImmutable
                                                              format:NSPropertyListXMLFormat_v1_0
                                                    errorDescription:nil];

다른 팁

There is a tutorial to get your preload data into plist.May be it will help you.

this link

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top