文字列キーと数値を含む plist ファイルがあります。私は、NSDictionary オブジェクトに plist の内容をコードでうまく入力できたと思います。
NSBundle* bun = [NSBundle mainBundle];
NSString* path = [bun pathForResource:@"Tempos" ofType:@"plist"];
tempos = [NSDictionary dictionaryWithContentsOfFile:path];
さて、ここが私が理解していない部分です。
id object = [tempos objectForKey:@"Allegro"];
NSLog(@"bpm: %@", object);
目的の数 を出力します168
。
NSInteger beats = (NSInteger)[tempos objectForKey:@"Allegro"];
NSLog(@"bpm: %ld", beats);
代わりに、 を出力します43203
。
さらに重要なことは、私が試したときに
bpm = (NSInteger)[tempos objectForKey:@"Allegro"];
に43203
配属されbpm
ます。代わりにどのように168
割り当てられbpm
ますか??