标签:路径 port str for direct 打印 use bottom name
可以先在程序打印沙盒路径:
NSLog(@"路径%@",NSHomeDirectory());
----------------------------------------------------其中一个沙盒存储更新与读取方法方法------------------------------------------------------
#import <Foundation/Foundation.h>
@interface ConfigData : NSObject
//保存到沙盒中
+ (void)saveCache:(NSString *)keyName andString:(NSString *)str;
//从沙盒中读取
+ (NSString *)getCache:(NSString *)keyName;
@end
#import "ConfigData.h"
@implementation ConfigData
+ (void)saveCache:(NSString *)keyName andString:(NSString *)str
{
NSUserDefaults * setting = [NSUserDefaultsstandardUserDefaults];
NSString * key = [NSStringstringWithFormat:@"OrderId-%@",keyName];
[setting setObject:str forKey:key];
[setting synchronize];
}
+ (NSString *)getCache:(NSString *)keyName
{
NSUserDefaults * settings = [NSUserDefaultsstandardUserDefaults];
NSString *key = [NSStringstringWithFormat:@"OrderId-%@",keyName];
NSString *value = [settings objectForKey:key];
return value;
}
@end
标签:路径 port str for direct 打印 use bottom name
原文地址:http://www.cnblogs.com/workky/p/6059293.html