discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing Property-Lists


From: Richard Frith-Macdonald
Subject: Re: Parsing Property-Lists
Date: Mon, 12 Apr 2004 04:29:00 +0100


On 11 Apr 2004, at 19:11, Philip Mötteli wrote:

Hi


I have a very simple 'Localizable.strings':

"test"="Test";


When I try to use it, I have a very weird error:

<NSException: 8740f68> NAME:NSGenericException REASON:Parse failed at line 1 (char 7) - extra data after parsed string


The parsing goes through the following steps (backtrace):

#0  parsePlItem at NSString.m:5355
#1  0x40162a80 in GSPropertyList at NSString.m:5644
#2  0x4015f7f4 in -[NSString propertyList] at NSString.m:4494
#3 0x400f1dea in -[NSDictionary initWithContentsOfFile:] at NSDictionary.m:510 #4 0x400f221e in +[NSDictionary dictionaryWithContentsOfFile:] at NSDictionary.m:591

The problem is that you are trying to treat your file as if it contains data in property list format ... which it doesn't.

Your file is in 'strings' format (and you have correctly given it a 'strings' extension rather than the '.plist' extension conventionally used for files in property list format.

The OpenStep API specifies a method of NSString for parsing strings files ... -propertyListFromStringsFileFormat, and an NSDictionary method for producing strings file format data ... -descriptionInStringsFileFormat






reply via email to

[Prev in Thread] Current Thread [Next in Thread]