ゴール
以下のようなNSDictionaryから"Timestamp"をlongとして値を取り出したい
// *dict { Number = 1408756029; Message = "hogeee"; }
解決
NSDictionary
のobjectForKey
を使ってから、longLongValue
でキャストする
long num = [[dict objectForKey:@"Finish"] longLongValue];
ちなみにNSInteger
として欲しかったら同様に、integerValue
を使う
NSInteger num = [[dict objectForKey:@"Finish"] integerValue];
DRYな備忘録