普通加密方法是讲密码进行加密后保存到用户偏好设置中 钥匙串是以明文形式保存,但是不知道存放的具体位置 一. base64加密 base64 编码是现代密码学的基础 基本原理: 原本是 8个bit 一组表示数据,改为 6个bit一组表示数据,不足的部分补零,每 两个0 用 一个 = 表示 用base64 编码之后,数据长度会变大,增加了大约 1/3 左右.(8-6)/6 可进行反向解密 Xcode7.0 之后出现的 编码有个非常显著的特点,末尾有个 = 号 将文件进行加密 // 获取需要加密文件的…
认识下三种IOS常见的回调模式. 代理模式作为IOS中最常见的通讯模式,代理几乎无处不在. 这里有一个数组,我们首先通过代理的方式将数组传递到其他方法中去. 设置协议及方法 @protocol CallBackDelegate; @interface ViewController : UIViewController @property (weak, nonatomic) id<CallBackDelegate> delegate; @end @protocol CallBackDelegat…
今天在开发过程中用到了UITableView,在对cell进行设置的时候,我发现对UITableViewCell的重用设置的方法有如下两种,刚开始我也不太清楚这两种之间有什么区别.直到我在使用方法二进行重用的时候,具体实现代码如下,其中CJMeetingReplyBasicCell是我自定义的UITableViewCell类型,但是在运行的时候每次都在调用 CJMeetingReplyBasicCell *cell = [tableView dequeueReusableCellWithIden…
1.performSelector [self performSelector:@selector(delayMethod) withObject:nil/*可传任意类型参数*/ afterDelay:2.0]; 注:此方法是一种非阻塞的执行方式,未找到取消执行的方法. 2.NSTimer定时器 NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(delayMeth…
转载自:https://www.cnblogs.com/bekeyuan123/p/6891875.html 数组的定义: // 3种定义方式 int[] arr = new int[5]; int[] arr1 = {1,2,3,4,5}; int[] nums = new int[]{1, 2, 3}; long[] arr2 = new long[6]; String[] strs = new String[5]; // 数组可以存储引用类型 Person[] ps = new Perso…
一:选择排序和冒泡排序 这两种排序比较简单,直接贴出代码: #include <stdio.h> void choose_sort(int *arr, int n); void bubble_sort(int *arr, int n); void show(int *arr, int n); int main() { ] = {, , , , , , , , , }; /*选择排序*/ choose_sort(arr, ); show(arr, ); /*冒泡排序*/ bubble_sort(…
1.原型链继承 // 1.原型链继承 /* 缺点:所有属性被共享,而且不能传递参数 */ function Person(name,age){ this.name = name this.age = age } Person.prototype.sayName = () =>{ console.log(this.name) } function Man(name){ } Man.prototype = new Person() Man.prototype.name = 'zhangsan' va…
1.foreach遍历 $arr[] = array('first'=>green,'second'=>'yellow','third'=>'blue'); foreach($arr as $key=>$val){ echo $key.'-'.$val; echo ' '; } 输出结果: first-green second-yellow third-blue 2.while-each遍历 $arr[] = array('first'=>green,'second'=>…
<code class="language-html"><!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scal…
1.base64 Python内置的base64模块可以实现base64.base32.base16.base85.urlsafe_base64的编码解码,python 3.x通常输入输出都是二进制形式,2.x可以是字符串形式. base64模块的base64编码.解码调用了binascii模块,binascii模块中的b2a_base64()函数用于base64编码,binascii模块中的a2b_base64()函数用于base64解码. >>>import base64 >&…