我目前正在iOS设备上保存一个NSDictionary文件.但是,NSDictionary文件是可读的XML.我不希望人们能够进入并阅读内容,因此我需要能够在写入时加密文件并在再次加载时解密.
我目前正在保存这样的文件:
NSFileManager* fileManager = [NSFileManager defaultManager];
if (!fileManager)
{
NSLog(@"Failed to get file manager to save.");
return;
}
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [paths objectAtIndex:0];
NSString* filePath = [documentsDirectory stringByAppendingPathComponent:@"save.dic"];
[m_dictionary writeToFile:filePath atomically:YES];
Run Code Online (Sandbox Code Playgroud)
我正在加载这样的字典:
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [paths objectAtIndex:0];
NSString* filePath = [documentsDirectory stringByAppendingPathComponent:@"save.dic"];
m_dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
Run Code Online (Sandbox Code Playgroud)
谁能告诉我一个加密\解密这个的好方法?
干杯,里奇
我在UIView中有一个UIButton,它位于UIViewController中,我已经从.xib文件中分配和输入.
当将IBAction挂钩到UIButton的"Touch Down"事件时,它会正确触发.但如果我把它连接到'Touch Up Inside'事件,它就不会响应.
其他事件也不起作用.'触摸拖动输入','触摸拖动退出','触摸外部'等.仅触摸向下.
有谁知道为什么会这样?
该按钮是视图控制器中的简单圆角矩形按钮.我已经加载了视图控制器:
-(void) pushNewViewController
{
MyViewController* newViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
[self.view addSubview:newViewController.view];
[newViewController release];
}
Run Code Online (Sandbox Code Playgroud)
我在IB中将此按钮添加到圆形rect按钮到MyViewController.我创建了以下IBActions:
-(IBAction) buttonTouchDown:(id)sender
{
NSLog(@"Button Touch Down Event Fired.");
}
-(IBAction) buttonTouchUpInside:(id)sender
{
NSLog(@"Button Touch Up Inside Event Fired.");
}
Run Code Online (Sandbox Code Playgroud)
在IB I菜单中单击按钮并将Touch Down插座拖动到MyViewController并选择buttonTouchDown:.保存了IB xib.
当我运行并测试按钮并获得"Button Touch Down Event Fired"日志消息时.
但是当我回到IB并将Action更改为Touch Up Inside并将其连接到buttonTouchUpInside:IBAction并保存.我再次测试,没有得到回应.
此致,Rich
我想使用添加剂混合模式绘制图像.但我不想使用OpenGL.我找不到任何要做的事,也许Quartz2D中有什么东西?
谁能指出我正确的方向?
干杯,里奇
我们正在尝试删除不再需要的软件仓库的流.
在图表视图中,我右键单击并选择了删除流.该流已从"图表视图"中删除,但它仍存在于"库"视图中.
我们想完全删除它,但我们似乎无法做到这一点.
'p4 streams'不知道它.
流中仍有一些文件.我想知道我们是否需要先删除这些文件.
谢谢, - Rich