NSMutableDictionary
ファイルに書き込むときに、エントリを次のようにしようとしています。
<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>
私のファイルは次のようになります。
<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>
NSCharacterSet
このように使用して、キー文字列とオブジェクトから空白と改行をトリミングしようとしました
NSString *trimmedArtistString = [ArtistString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
しかし、それはうまくいきませんでした。
これはできますか?