• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems parsing plist files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems parsing plist files


  • Subject: Problems parsing plist files
  • From: Peter Schols <email@hidden>
  • Date: Mon, 7 Nov 2005 13:20:42 +0100

Hi,

I'm experiencing a very strange problem. The following code initializes an NSDictionary with a .plist file on my web server. This code used to work just fine over the past 3 years (and it sill worked a few weeks ago) but now it does not work anymore:

NSString *traceList = @"http://www.orbicule.com/UCservices/trace.plist";;
NSURL *traceURL = [NSURL URLWithString:traceList];
NSDictionary *traceDictionary = [NSDictionary dictionaryWithContentsOfURL:traceURL];
NSLog(@"Trace dbase: %@", traceDictionary);


The traceDictionary is null and the run log shows the following message:

2005-11-07 13:03:45.932 uc[850] CFLog (0):
CFPropertyListCreateFromXMLData(): plist parse failed; the data is not proper UTF-8. The file name for this data could be:
/Users/mac/Library/Cookies/Cookies.plist
The parser will retry as in 10.2, but the problem should be corrected in the plist.
2005-11-07 13:03:46.006 uc[850] Trace dbase: (null)


Since the code looks fine to me and since it used to work just fine about two weeks ago, I'm clueless about what could be going wrong here.
When I replace the second line with the following line of code, it does work:
NSURL *traceURL = [NSURL fileURLWithPath:@"/Users/mac/Sites/Orbicule/ UCServices/trace.plist"];


So it seems like the NSDictionary can be initialised using a local file but not using a file on my web server. Moreover, other code in my app that does similar things (i.e. initialising dictionaries with plist files) gives similar error messages, even when the plist file is local.

I have searched the archives and I found some references to CFPropertyListCreateFromXMLData but they don't seem to apply here. I have played with different encodings and I have used the plutil tool to no avail.

Thanks a lot in advance!

Peter


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problems parsing plist files
      • From: Nicko van Someren <email@hidden>
    • Re: Problems parsing plist files
      • From: "I. Savant" <email@hidden>
  • Prev by Date: RE: NSTextView scrolling issue.
  • Next by Date: Re: Easy backtrace
  • Previous by thread: Demande de renseignements sur NSDatePicker
  • Next by thread: Re: Problems parsing plist files
  • Index(es):
    • Date
    • Thread