• 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
Re: Dictionary won't write to disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dictionary won't write to disk


  • Subject: Re: Dictionary won't write to disk
  • From: SA Dev <email@hidden>
  • Date: Thu, 9 Jun 2005 08:16:47 -0400


On Jun 9, 2005, at 7:37 AM, Julio Cesar Silva dos Santos wrote:
I am really sorry but I have been trying this for a long time but apparently the only application that understands iTunes Music Library.xml is iTunes itself. I think that something in the file's structure is not NSDictionary standard, but as we do not have access to iTunes code we will never know...


This is quite simply not true. I wrote an engine to translate iTunes *and* iPhoto libraries into something my app can use (basically just loading it in and grabbing the data I wanted, then organizing it the way I needed it) in less than an hour. The code that handled loading the dictionary was the easiest part.

From your previous code example, you created a separate string and expanded the tilde, then gave that string to the 'did it load' if statement to log whether or not it loaded. Rather than that, how about logging out the final string (after you create the expanded path string) before trying to create a dictionary with it? Try that and tell us what exact path you get (you can change the user name if you'd like).

Often, when I can't get a dictionary to load, it's because the path string is not right somehow due to an assumption I made. Logging the path string just before trying to load the dictionary shows me exactly what path I'm sending. It's almost always due to a bad path. HOWEVER, it could ALSO be due to an odd permissions problem. Make sure your user account has appropriate access to this file as well, though this isn't as likely as a bad path.

Unfortunately, with your statement above, you're playing into the same trap many programmers fall into. That is, "If I can't get it to work, obviously it just doesn't work." The XML file was created specifically so we (developers) can access the data. It *is* a standard PLIST format and simply creating a dictionary with the contents of this file with one single line *does* work. Every time. Provided the path is correct and you have permission. ;-)


_______________________________________________ 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
References: 
 >Dictionary won't write to disk (From: Dave DeLong <email@hidden>)
 >Re: Dictionary won't write to disk (From: Andy Lee <email@hidden>)
 >Re: Dictionary won't write to disk (From: Dave DeLong <email@hidden>)
 >Re: Dictionary won't write to disk (From: Andy Lee <email@hidden>)
 >Re: Dictionary won't write to disk (From: Dave DeLong <email@hidden>)
 >Re: Dictionary won't write to disk (From: Julio Cesar Silva dos Santos <email@hidden>)

  • Prev by Date: Strange NSTextField Problems have me Stumped
  • Next by Date: Re: Universal Binaries, x86 and compatibility...
  • Previous by thread: Re: Dictionary won't write to disk
  • Next by thread: Re: Dictionary won't write to disk
  • Index(es):
    • Date
    • Thread