Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This question is rather old, but I came upon it as I had a similar problem, so for anyone who still needs a solution. I managed to figure out a way of getting the total tracks number and the track number using the following code:</p> <pre><code>NSString *value = @"&lt;0000000a 00140000&gt;" //[item stringValue] (in this case 10/20) NSString *track_no_hex = [[value componentsSeparatedByString:@" "][0] stringByReplacingOccurrencesOfString:@"&lt;" withString:@""]; NSString *total_track_no_hex = [[value componentsSeparatedByString:@" "][1] stringByReplacingOccurrencesOfString:@"&gt;" withString:@""]; NSString *track_no = @""; for(int k=0;k&lt;=4;k+=4){ unsigned result = 0; NSScanner *scanner = [NSScanner scannerWithString:[track_no_hex substringWithRange:NSMakeRange(k, 4)]]; [scanner scanHexInt:&amp;result]; if(result == 00){ } else{ track_no = [NSString stringWithFormat:@"%@%u",track_no,result]; } } NSString *total_track_no = @""; for(int k=0;k&lt;=4;k+=4){ unsigned result = 0; NSScanner *scanner; if(k+4&lt;=[total_track_no_hex length]){ scanner = [NSScanner scannerWithString:[total_track_no_hex substringWithRange:NSMakeRange(k, 4)]]; } else{ } [scanner scanHexInt:&amp;result]; if(result == 00){ } else{ total_track_no = [NSString stringWithFormat:@"%@%u",total_track_no,result]; } } NSLog(@"%@/%@",track_no, total_track_no); // Output 10/20 </code></pre> <p>This will work fine for track numbers under 14461 which should be large enough considering iTunes max track number is 999.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload