I'm trying to make the entries in my NSMutableDictionary
look like this when written to a file:
<dict>
<key>Track ID</key><integer>686</integer>
<key>Name</key><string>Poetic Justice (Feat. Drake)</string>
<key>Artist</key><string>Kendrick Lamar</string>
<key>Album</key><string>Good Kid M.A.A.D City-(Deluxe Edition)</string>
</dict>
Here's what my file looks like now:
<dict>
<key>Track ID</key>
<integer>686</integer>
<key>Name</key>
<string>Poetic Justice (Feat. Drake)</string>
<key>Artist</key>
<string>Kendrick Lamar</string>
<key>Album</key>
<string>Good Kid M.A.A.D City-(Deluxe Edition)</string>
</dict>
I have tried trimming the whitespace and newlines from the key strings and objects using NSCharacterSet
like this
NSString *trimmedArtistString = [ArtistString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
But that didn't work.
Can this be done?