UITabView内部元素拖动

UITabView内部元素拖动 1加手势识别器 - (void)longPressGestureRecognized:(id)sender{ UILongPressGestureRecognizer *longPress = (UILongPressGestureRecognizer *)sender; UIGestureRecognizerState longPressState = longPress.state; //手指在tableView中的位置 _fingerLocation = [longPress locationInView:self]; //手指按住位置对应的indexPath,可能为nil _relocatedIndexPath = [self indexPathForRowAtPoint:_fingerLocation]; switch (longPressState) { case UIGestureRecognizerStateBegan:{ //手势开始,对被选中cell截图,隐藏原cell break; } case UIGestureRecognizerStateChanged:{ //点击位置移动,判断手指按住位置是否进……

阅读全文

apt dpkg 基础命令

apt-get 基础命令 安装软件 apt-get install softname1 softname2 softname3…… 卸载软件 apt-get remove softname1 softname2 softname3…… 卸载并清除配置 apt-get remove –purge softname1 更新软件信息数据库 apt-get update 进行系统升级 apt-get upgrade 搜索软件包 apt-cache search softname1 softname2 softname3…… apt-cache search # ------(package 搜索包) apt-cache show #------(package 获取包的相关信息,如说明、大小、版本等) sudo apt-get install # ------(package 安装包) sudo apt-get……

阅读全文

raspi 基本软件

更改SD卡配置 sudo raspi-config 带3.5LCD 更新 sudo apt-mark hold raspberrypi-bootloader sudo apt-get update sudo apt-get upgrade 源 sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak sudo nano /etc/apt/sources.list sudo apt-get update deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib deb-src http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib 屏幕校准 su pi DISPLAY=:0.0 xinput_calibrator //修改参数 sudo nano /etc/X11/xorg.conf.d/99-calibration.conf //文件内容 Option “Calibration” "3968 89 193 3928" smb //安装smb sudo apt-get install samba samba-common-bin //备份 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_bak //修改文件 sudo nano /etc/samba/smb.conf //版本1 [global] log file = /var/log/samba/log.%m [topest_dic] path = / read only = no……

阅读全文

linux 常用指令

Linux linux //删除文件 rm //删除文件夹 rm -rf //创建文件夹 mkdir //重启 reboot //空间大小 df -h //文件查找 find . -name "*.log" find . -name "ubinize.cfg" //删除log for i in `find . -name "*.log"`; do cat /dev/null >$i; done //解压 tar -zxvf //压缩 tar -zcvf……

阅读全文

迅雷赚钱 php ftp sql

step 1: entware telnet或者ssh,用户名root密码为你的串号后八位。 cd /opt wget http://qnapware.zyxmon.org/binaries-armv7/installer/entware_install_arm.sh chmod 777 ./entware_install_arm.sh sh ./entware_install_arm.sh step 2: FTP 安装并修改配置文件 /opt/bin/opkg update /opt/bin/opkg install vsftpd-ext 修改配置文件: vi /opt/etc/vsftpd/vsftpd.conf Anonymous_enable=NO Write_enable=YES Local_enable=YES Ascii_upload_enable=YES Ascii_download_enable=YES VI操作:键入i进入编辑模式,esc退出编辑模式 输入:wq保存 登录名为系统账号密码! passwd root 修改密码(假设密码改为"XXX&qu……

阅读全文

Git Svn 常用基本命令

git 相关 改到当前文件目录 1 git status 获取文件夹仓库状态 2 git add ./ 本地文件有更新需要使用 3 git status 查看更新后状态 4 git config –global user.email “[email protected]” 重设用户名 5 git reset –hard 024383f58fb3 024383f58fb3 从XCODE 版本管理中获得 版本回退 SVN 相关 改到当前文件目录 1 svn checkout http://[email protected]:8080/scm/svn/documents 2 svn commit -m “fix bug” 3 svn update 4 svn checkout http://[email protected]:8080/scm/svn/documents —username zhouqr —password xxxx ./……

阅读全文

ALAsset中fullScreenImage和fullResolutionImage使用中的区别

ALAsset fullScreenImage fullResolutionImage 选中 问题描述 1 ALAsset读图 fullScreenImage 情况正常 2 fullResolutionImage 图片反转 需要重新设置图片选转值 // fullScreenImage可以直接初始化为UIImage UIImage *tempImg = [UIImage imageWithCGImage:asset.defaultRepresentation.fullScreenImage]; // 需传入方向和缩放比例,否则方向和尺寸都不对 UIImage *tempImg = [UIImage imageWithCGImage:asset.defaultRepresentation.fullResolutionImage scale:asset.defaultRepresentation.scale orientation:(UIImageOrientation)asset.defaultRepresentation.orientation]; //实际使用 注意内存释放 ALAsset *asset = assets[i]; ALAssetRepresentation *assetRep = [asset defaultRepresentation]; UIImage *image = [UIImage imageWithCGImage:[assetRep fullResolutionImage] scale:assetRep.scale orientation:(UIImageOrientation)assetRep.orientation]; 遍历视频文……

阅读全文

class-dump

class-dump class-dump 官网 class-dump-3.5.dmg 安装 1.将class-dump-3.5.dmg内的class-dump拉到目录: /usr/local/bin 命令 1.class-dump -H /Applications/Calculator.app -o /Users/Rio/Desktop/calculate\ heads 2.class-dump -H /Applications/Calculator.app -o /Users/ray/Desktop/ipa/calculator \head……

阅读全文

归档

代码 NSString *UserId = [NSString stringWithFormat:@"%ldAAAAAAATTTTTTTT.data", [PKUserInfoTool userInfo].uid]; NSString *PKPostLablePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:UserId]; NSMutableArray *ary = [NSMutableArray array]; for (int i = 0; i < 100; i++) { [ary addObject:[NSArray arrayWithObjects:[NSString stringWithFormat:@"label%d",i],@"123",@"456", nil]]; } PKLog(@"pring in ram%@", ary); //写入数组 [[NSFileManager defaultManager] removeItemAtPath:PKPostLablePath error:nil]; [NSKeyedArchiver archiveRootObject:ary toFile:PKPostLablePath]; //读取数组 ary = nil; PKLog(@"read from local:%@", ary); ary = [NSKeyedUnarchiver unarchiveObjectWithFile:PKPostLablePath]; PKLog(@"read from local:%@", ary); 数据内容 016-04-21 15:17:57.338 djcars[5590:140020] pring in ram[ [ label0, 123, 456 ], [ label1, 123, 456 ], [ label2, 123, 456 ], [ label3, 123, 456 ], [ label4, 123, 456 ], [ label5, 123, 456 ], [ label6, 123, 456 ], [ label7, 123, 456 ], [ label8, 123, 456 ], [ label9, 123, 456 ] ]……

阅读全文

MJExtension 模型转换

起因 来了新公司,看看上一手的代码,如果上一手,有使用过类似的工具就不会导致现在呢么多坑. 快速引用 #import "MJExtension.h" MJCodingImplementation + (NSDictionary *)replacedKeyFromPropertyName{ return @{@"hashString":@"hash"}; } + (NSDictionary *)mj_objectClassInArray{ return @{ @"newsList":[TTVHomeChannelNewsModelNewsList class], @"headlineList":[TTVHomeChannelNewsModelNewsList class], }; } MJExtension 归档 测试程序 NSString *UserId = [NSString stringWithFormat:@"%ldAAAAAAATTTTTTTT.data", [PKUserInfoTool userInfo].uid]; NSString *PKPostLablePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:UserId]; NSMutableArray *ary = [NSMutableArray array]; for (int i = 0; i < 10; i++) { [ary addObject:[NSArray arrayWithObjects:[NSString stringWithFormat:@"label%d",i],@"123",@"456", nil]]; } PKLog(@"pring in ram%@", ary); PKLabelSelectionModel *data = [[PKLabelSelectionModel alloc] init]; data.ids = ary; //写入数组 [[NSFileManager defaultManager] removeItemAtPath:PKPostLablePath error:nil]; [NSKeyedArchiver archiveRootObject:data toFile:PKPostLablePath]; //读……

阅读全文