Re: Dictionary won't write to disk
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