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:
NSString *value = @"<0000000a 00140000>" //[item stringValue] (in this case 10/20)
NSString *track_no_hex = [[value componentsSeparatedByString:@" "][0] stringByReplacingOccurrencesOfString:@"<" withString:@""];
NSString *total_track_no_hex = [[value componentsSeparatedByString:@" "][1] stringByReplacingOccurrencesOfString:@">" withString:@""];
NSString *track_no = @"";
for(int k=0;k<=4;k+=4){
unsigned result = 0;
NSScanner *scanner = [NSScanner scannerWithString:[track_no_hex substringWithRange:NSMakeRange(k, 4)]];
[scanner scanHexInt:&result];
if(result == 00){
}
else{
track_no = [NSString stringWithFormat:@"%@%u",track_no,result];
}
}
NSString *total_track_no = @"";
for(int k=0;k<=4;k+=4){
unsigned result = 0;
NSScanner *scanner;
if(k+4<=[total_track_no_hex length]){
scanner = [NSScanner scannerWithString:[total_track_no_hex substringWithRange:NSMakeRange(k, 4)]];
}
else{
}
[scanner scanHexInt:&result];
if(result == 00){
}
else{
total_track_no = [NSString stringWithFormat:@"%@%u",total_track_no,result];
}
}
NSLog(@"%@/%@",track_no, total_track_no); // Output 10/20
这将对14461项下的轨道编号进行罚款,鉴于UNV最大轨道号码为999,该数字应当足够大。