2011-07-12 16 views
0

整数値の束をNSDictionaryに格納し、plistとして保存できるプロセスは何ですか?plistに格納される辞書の整数値

次に、そのplistをNSDictionaryに読み込んで、その値を取得する方法はありますか。

値の束を保存しておき、それをアプリの再起動時に読み込みたいと思います。

辞書内の整数値を格納するための

答えて

0

---

// saves integer as NSString. 
NSString *str = [NSString stringwithformat:@"%d", 234 (integer value)]; 

今NSDictionayから整数値を取得

// saves your integer value into dictionary.. 
NSDictionary *dict = [[NSDictionary alloc] setObject:str forkey:@"intervalue"]; 

as--辞書に上記整数値strを保存-----

//got the value in string format 
NSString *str = [dict objectforkey:@"integervalue"]; 

// from this we got the original integer value from the string... 
NSInteger integerValue = [str intValue]; 
関連する問題