Saucheong Ye

Results 40 comments of Saucheong Ye

## Tips #### AFNetWorking 简单判断网络存在情况 - 推荐实时网络监测 https://github.com/dustturtle/RealReachability

## iOS语言国际化 #### 1、选中工程->PROJECT->Localizations 添加需要国际化的语言 ![add language](https://github.com/sauchye/dev_notes/raw/master/resources/add_languages.png) #### 2、新建Strings File,分别新建:InfoPlist和Localizable ![new strings](https://github.com/sauchye/dev_notes/raw/master/resources/new.png) #### 3、选择添加的语言 ![localization language](https://github.com/sauchye/dev_notes/raw/master/resources/add.png) #### 4、最后就比较容易了 InfoPlist.string中存放App命名 ``` CFBundleDisplayName = "iOS奇淫技巧”;(Chinese(Simplified)) CFBundleDisplayName = "iOSTipsDemo”;(English) ``` Localisable ``` (English)...

## ARC - intro http://www.jianshu.com/p/1928b54e1253 http://www.jianshu.com/p/09c5141d4531?utm_campaign=maleskine&utm_content=note&utm_medium=writer_share&utm_source=weibo#

#### Tag遍历所有的按钮 ``` for (NSInteger i = babyGenderTag; i

### Json转Plist相互转换 http://json2plist.sinaapp.com/ ### Code Review http://mtydev.net/?p=59#comment-680 http://coolshell.cn/articles/11432.html#more-11432 ### 一些姿势 http://toutiao.io/subjects/35291 ### `Cell`复用文字加深处理 ``` if (!cell) { cell = [[CDRemindCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cdRemindCell]; }else{ while ([cell.contentView.subviews lastObject] != nil) {...

### 解决无导航栏push到有导航栏bug ``` - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:animated]; } - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; [self.navigationController setNavigationBarHidden:NO animated:animated]; } ``` 参考: http://blog.luckymore.wang/2015/05/19/iOS%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-%E4%BB%8EQQ%E7%9A%84%E4%B8%80%E4%B8%AABug%E5%BC%95%E5%8F%91%E7%9A%84%E5%85%B3%E4%BA%8E%E5%AF%BC%E8%88%AA%E6%A0%8F%E7%9A%84%E6%80%9D%E8%80%83/ http://www.jianshu.com/p/e4448c24d900/comments/3851074

### ``UITableView`` ``UITableViewStyleGrouped `` 去掉段头空白 `` self.automaticallyAdjustsScrollViewInsets = NO; `` ``` - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 0.01f; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return 10.f; } ``` ### ``UITableView`` ``Cell``单选 ```...

> https://github.com/soffes/SAMKeychain #import ``` NSDictionary *dd = @{@"pwd":self.passwordTextField.text, @"name":self.accountTextField.text, @"gender":@"1", @"age":@"22"}; NSData *data = [NSJSONSerialization dataWithJSONObject:dd options:NSJSONWritingPrettyPrinted error:nil]; //save data [SAMKeychain setPasswordData:data forService:serviceKey account:self.accountTextField.text error:nil]; //save string [SAMKeychain setPassword:self.passwordTextField.text forService:serviceKey...

>  内购 https://www.jianshu.com/p/cb1c8b4ba2c0 https://www.jianshu.com/p/86ac7d3b593a https://www.cnblogs.com/TheYouth/p/6847014.html

> spare 避免输入表情 emoji https://gist.github.com/cihancimen/4146056 ``` - (BOOL)stringContainsEmoji:(NSString *)string { __block BOOL returnValue = NO; [string enumerateSubstringsInRange:NSMakeRange(0, [string length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock: ^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {...