[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: Parsing Property-Lists
From: |
Manuel Guesdon |
Subject: |
Re[2]: Parsing Property-Lists |
Date: |
Thu, 15 Apr 2004 19:54:15 +0200 (CEST) |
On Mon, 12 Apr 2004 08:56:27 +0200 Philip Mötteli <Philip.Moetteli@tele2.ch>
wrote:
>| Am 12.04.2004 um 05:29 schrieb Richard Frith-Macdonald:
>| > On 11 Apr 2004, at 19:11, Philip Mötteli wrote:
>| >> 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
>|
>|
>| Thanks!
>| Actually, I'm coming from
>|
>| [[[WOApplication application] resourceManager] stringForKey:aKey
>| inTableNamed:@"Localizable" withDefaultValue:nil
>| inFramework:GSWFramework_all languages:[[self session] languages]]
>|
>|
>| I remember, that this used to work with Apple's WO, but now with GSW I
>| have this problem. Does that mean, that we have to change our approach
>| in GSW?
Yes. In fact, I've never noticed the difference between .strings and .plist