字典中要存储在plist中的整数值

字典中要存储在plist中的整数值,plist,nsdictionary,Plist,Nsdictionary,将一组整数值存储到NSDictionary中,然后将其保存为plist涉及哪些过程 那么,如何将plist读回NSDictionary,然后得到它们的值呢 我想存储一组值,然后在应用程序重新启动时读取它们。用于在字典中存储整数值--- 现在将上述整数值str另存到字典中-- 从NSDictionary中检索整数值----- // saves integer as NSString. NSString *str = [NSString stringwithformat:@"%d", 234 (in

将一组整数值存储到NSDictionary中,然后将其保存为plist涉及哪些过程

那么,如何将plist读回NSDictionary,然后得到它们的值呢


我想存储一组值,然后在应用程序重新启动时读取它们。

用于在字典中存储整数值---

现在将上述整数值str另存到字典中--

从NSDictionary中检索整数值-----

// saves integer as NSString.
NSString *str = [NSString stringwithformat:@"%d", 234 (integer value)];
// saves your integer value into dictionary..
NSDictionary *dict = [[NSDictionary alloc] setObject:str forkey:@"intervalue"];
//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];