浮生若梦

凡所有相,皆是虚妄


  • 首页

  • 归档

  • 分类

  • 搜索

Git 删除远程分支

发表于 2016-08-09   |   分类于 开发那些事 , Git   |  

直接上 Command

1
git push origin :branch_name

然而也有失败的时候~

这是为什么呢?

原来 master 分支是 Default Branch,Default branch是受保护的,改成gh-pages分支

再试下

Done!

另:删除远程分支前并不需要先删除本地分支,当前在哪个分支也没有关系。

参考:How to delete master branch

SSH 登陆 iOS 设备问题

发表于 2016-08-08   |   分类于 开发那些事 , iOS Reverse   |  

一、免密码 SSH 登陆

每次登陆手机都要输入root密码真的很烦~

  1. 删除 ~/.ssh/known_hosts 中 iOS 设备 IP 对应的条目,完整的一行都删掉
  2. 生成 authorized_keys

    1
    2
    ssh-keygen -t rsa
    cp ~/.ssh/id_isa.pub ~/authorized_keys
  3. 登陆 iOS 设备

    1
    ssh-keygen
  4. 登出

    1
    2
    scp ~/authorized_keys root@192.168.0.104:var/root/.ssh
    rm ~/authorized_keys
  5. Over~

二、重置 SSH 登陆密码

修改 /private/etc/master.password 文件,文件中会有以下一段:

1
2
3
4
root:xxxxxxxxxxxxx:0:0::0:0:System
Administrator:/var/root:/bin/sh
mobile:xxxxxxxxxxxxx:501:501::0:0:Mobile
User:/var/mobile:/bin/sh

将root:及mobile:后面的13个x字符处修改成/smx7MYTQIi2M,修改后保存此文件,SSH密码就重新回到默认的 alpine

加快 Xcode 编译速度

发表于 2016-08-02   |   分类于 开发那些事 , iOS   |  

修改 Build Settings

1、Build Active Architecture Only = YES

2、Debug Information Format = DWARF

UITableView#sectionHeaderHeight=0不起作用

发表于 2015-09-17   |   分类于 开发那些事 , iOS   |  

调用UITableView#sectionHeaderHeight = 0;时TableView会使用默认的高度。

这样UITableView#sectionHeaderHeight = CGFLOAT_MIN; 就达到目的了

How to change height of grouped UITableView header?

如何把图片资源打包成Bundle

发表于 2015-08-20   |   分类于 开发那些事 , iOS   |  

创建Bundle

很简单。
打开Finder,直接创建Test.bundle;右键->显示包内容,把图片文件拖进去就ok了.
(或者先创建Test目录,把图片拖进去后,重命名为Test.bundle)

使用Bundle

(1) 直接使用Test.bundle中图片

1
[UIImage imageName:@"Test.bundle/error"];

(2) 获取Test.bundle路径

1
2
NSString *testBundlePath = [[NSBundle main] pathForResource:@"Test" ofType:@"bundle"];
NSBundle *testBundle = [NSBundle bundleWithPath:testBundlePath];

参考:
http://stackoverflow.com/a/2805618/3355097
https://developer.apple.com/

UITextField监听

发表于 2015-08-17   |   分类于 开发那些事 , iOS   |  

1、设置delegate

2、NSNotification

3、KVO

4、Target-Action

http://stackoverflow.com/questions/7010547/uitextfield-text-change-event

第一种方式可能监听不到改变

Xcode使用-Code Snippet

发表于 2015-08-16   |   分类于 开发那些事 , iOS   |  

参考:http://mobile.51cto.com/hot-431722.htm

1
2
3
4
5
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
<#statements#>
}

UIWindow介绍

发表于 2015-08-14   |   分类于 开发那些事 , iOS   |  

创建一个Window

1
2
3
4
5
6
UIWindow *greenWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
greenWindow.windowLevel = UIWindowLevelStatusBar;
greenWindow.backgroundColor = [UIColor greenColor];
greenWindow.alpha = 0.3;
// default hidden=YES
greenWindow.hidden = NO;

这样greenWindow就已经放在屏幕上显示了

隐藏Window

1
2
greenWindow.hidden = YES;
greenWindow = nil;

给Window添加单击事件

1
2
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:selector(greenWindowTapped:)];
[greenWindow addGestureRecognizer:tap];

iOS自动化集成测试

发表于 2015-08-13   |   分类于 开发那些事 , iOS   |  

移步 http://rannie.github.io/ios/2014/12/29/xcodebuild-jenkins-ci.html

今晚测试,更博。

iOS面试题

发表于 2015-08-03   |   分类于 开发那些事 , Interview   |  

强力iOS面试题

1234
时光

时光

32 日志
12 分类
18 标签
RSS
GitHub StackOverflow Twitter Weibo
© 2012 - 2017 时光
由 Hexo 强力驱动
主题 - NexT.Pisces