I am new to Objective-C. I am now trying to get song information of selected track. But I can't.
I've found that following code
iTunesFileTrack *cuTrack = [iTunesApp.currentTrack get];
NSLog(@"result = %@",cuTrack);
outputs reference(?) of current track. Like:
2014-01-21 00:07:09.908 CommunicateWithiTunes[43052:303] result = <ITunesFileTrack @0x60800005de20: ITunesFileTrack id 12825 of ITunesUserPlaylist id 12773 of ITunesSource id 74 of application "iTunes" (166)>
so it can be re-usable like:
NSLog(@"name = %@", cuTrack.name);
NSLog(@"location = %@", cuTrack.location);
But if I re-write code as selection like:
iTunesFileTrack *selectedTrack = [iTunesApp.selection get];
NSLog(@"result = %@",selectedTrack);
outputs text(?) of selected track like:
2014-01-21 00:15:40.753 CommunicateWithiTunes[43145:303] result = (
"<ITunesFileTrack @0x61000044fe70: ITunesFileTrack id 12825 of ITunesUserPlaylist id 12773 of ITunesSource id 74 of application \"iTunes\" (166)>"
so the result can't be re-usable.
Why this kind of difference occur? Or Can anyone tell me the correct way to get information of selected track?