#笔记

防止弱化的self在使用时被提前释放造成crash

 

2017面试题链接:

http://www.jianshu.com/p/f9eb6b315c08

http://www.cocoachina.com/ios/20150803/12872.html

 

苹果加急审核通道: 

https://developer.apple.com/contact/app-store/?topic=expedite (request an expedited app review)

 

iOS系统提示音大全: 

http://iphonedevwiki.net/index.php/AudioServices

AudioServicesPlaySystemSound (1007);

 

清除Xcode->Organizer界面左侧的无用的archive列表

command + shift + G 前往文件夹~/library/Developer/Xcode/products 删除不用的就可以了.

 

环信头像处理:

1.登录或更换头像存储自己的头像在本地

2.消息扩展,发送自己的头像url供另一台设备使用 (<EaseMessageViewController.m>_sendMessage:isNeedUpload:)

3.在收到消息中处理消息扩展,本地存储聊天对象的头像url和下载image存储,对应每个环信用户的id(<EaseMessageViewController.m> didReceviceMessages:)

4.在消息赋值展示的地方判断发送者(展示自己的头像),接收到他人的消息那么头像从本地缓存中获取,如果没有则使用消息扩展中的url(<EaseBaseMessageCell.m> setModel:)

5.会话列表头像展示,从缓存中取,如果没有则从消息扩展中使用url;然后存储最新消息附带的头像信息(EaseConversationListViewController.m)

备注,先修改自己服务器上用户的备注信息,然后在本地存储一份做记录

环信坑:1.发送语音要在主线程更新UI和播放动画 2.EaseUI国际化不起作用,全是英文

 

相册预览 icloud

 

App下载链接拼接:

https://itunes.apple.com/cn/app/idxxxxxxxxx?mt=8

 

iOS真机支持文件路径:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

(比如让 Xcode9.0 支持 iOS11.3真机,只需下载相应的支持文件丢到该目录即可)

 

获取属性

获取属性
unsigned int count;
Ivar *ivars =  class_copyIvarList([UIAlertAction class], &count);
for (int i = 0; i < count; i++) {
    Ivar ivar = ivars[i];
    const char * cName =  ivar_getName(ivar);
    NSString *ocName = [NSString stringWithUTF8String:cName];
    NSLog(@"这里是runtime获取到alertaction的属性  %@",ocName);
}
free(ivars);

系统滤镜

//增强
- (CIImage *)filteredImageUsingContrastFiltersOnImage:(CIImage *)image {
    return [CIFilter filterWithName:@"CIColorControls" withInputParameters:@{@"inputContrast":@(1.1),kCIInputImageKey:image}].outputImage;
}
//灰度
- (CIImage *)filteredImageUsingEnhanceFilterOnImage:(CIImage *)image {
    return [CIFilter filterWithName:@"CIColorControls" keysAndValues:kCIInputImageKey, image, @"inputBrightness", [NSNumber numberWithFloat:0.0], @"inputContrast", [NSNumber numberWithFloat:1.14], @"inputSaturation", [NSNumber numberWithFloat:0.0], nil].outputImage;
}
//自动增强
- (CIImage *)autoAdjustmentFilter:(CIImage *)inputImage {
    NSArray *filters = [inputImage autoAdjustmentFiltersWithOptions:@{kCIImageAutoAdjustRedEye: @(false)}];
    for (CIFilter *filter in filters) {
        [filter setValue:inputImage forKey:kCIInputImageKey];
        inputImage = [filter outputImage];
    }
    return inputImage;
}

Git 配置

git config --global user.name "daitao"
git config --global user.email "daitao@chaorey.com"

ssh-keygen -t rsa -C "daitao@chaorey.com" -b 4096
cat ~/.ssh/id_rsa.pub

UITextField

//UITextField创建后再设置placeholder文字,placeholder文字会比较深。

[self.textField setValue:[UIColor colorWithHexString:@"#c3c3c3"] forKeyPath:@"_placeholderLabel.textColor"];

//设置placeholder颜色需放在设置placeholder文字后面才生效.

自定制UIAlertController  KVC

attributedTitle
attributedMessage
titleTextColor

制作加密压缩包

zip -e  test.zip  test.txt
zip -er test.zip  Desktop/test/

使用fcrackzip暴力破解.zip

-D 表示要使用字典破解
-p 表示要使用那个字典破解
-b 表示使用暴利破解的方式
-c 'aA1' 表示使用大小写字母和数字混合破解的方式
-l 1-10 表示需要破解的密码长度为1到10位
-u 表示只显示破解出来的密码,其他错误的密码不显示出


$ fcrackzip -b -c ‘aA1’ -l 1-10 -u test.zip
$ fcrackzip -D -p dic.txt -u test.zip

终端命令

终端切入root系统:
1. sudo su  
2. sudo -i

切回普通用户:
1. ctrl + d  或者 logout   
2. exit

获取根目录下文件的大小
du -sh *

获取目录下文件的大小
du -d 1 -h


查询程序行数:
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l

查看安装的JDK版本和安装目录 
/usr/libexec/java_home -V

启动黑域
adb shell sh /data/data/me.piebridge.brevent/brevent.sh

给相应的文件夹添加操作权限
sudo chown -R $USER /usr/local   


撤销commit但是还未push的提交 
git reset HEAD~

Redis 操作

启动redis服务
redis-server

设置密码
config set requirepass 123456

查询密码
config get requirepass

验证权限
auth 123456

设置通知??参数
config set notify-keyspace-events Egx

以上设置重启后失效,另外一种方法就是在redis.conf中加入对应字段
1378 requirepass 123456
1379 notify-keyspace-events Egx

然后指定配置文件启动redis服务
redis-server /usr/local/redis-5.0.2/redis.conf

mongodb操作

brew services start/stop mongodb  启动/关闭
mongo 进入图形化界面
brew services list 查看homebrew安装的服务情况

登入mysql

mysql -u root -p

Vue 使用iView引入less文件进行主题切换报错

观察安装的less版本,如果是3.x那么考虑将其作降级处理 npm install less@2.7.3 --save-dev
然后重启服务

mybatis使用问题记录

xml中 #{} 会自动拼接前后引号形成字符串,${} 会保持变量原来的值常用于id和数字类型

模糊查询写法   like ‘%${name}%’    或者  like CONCAT('%',#{name},'%')

desc  rank 作为表字段名会与关键字冲突,查询时需使用 `desc`  `rank`

入参为时间戳(1552509966000) 时使用Date类型接收,xml中使用#{}

mysql时区问题

SHOW VARIABLES LIKE '%time_zone%';

SET GLOBAL time_zone = '+8:00';

SET time_zone = '+8:00';

FLUSH PRIVILEGES;

小程序setData高级操作

  toggleSeleted(ev) {

    var index = ev.currentTarget.dataset.index;

    var seletedKey = 'items[' + index + '].selected';

    this.setData({

      [seletedKey]: ! this.data.items[index].selected

    })

  },

旧项目libstdc++链接库不存在的问题

Xcode升级到Xcode10.0后,由于去掉陈旧的libstdc++库替换为libc++,libc++相对是苹果最新版的C++库,经过优化并全面支持C++11

将 libstdc++、libstdc++.6、libstdc++6.0.9拷贝到Xcode的如下目录:

1.真机环境:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

2.模拟器环境:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

Tomcat设置默认访问根目录

修改tomcat目录下 /conf/server.xml文件,在<Host></Host>中添加Context配置行

然后关闭重启tomcat服务生效

 ./shutdown.sh  
 ./startup.sh

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值