- 博客(19)
- 收藏
- 关注
原创 编写整洁的TableView代码--基于Block的TableView/CollectionView数据源封装
iOS界面开发中,每个控制器中重复度最高的代码,可能就是 TableView 的相关方法了。- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;- (UITableViewCell *)tableView:(UITableView *)tableView ce
2016-11-12 14:05:59 820
翻译 Swift语言编程风格指导:12月更新
一、Optional Binding 可选类型绑定:我们总结出两条关于命名的规范1、不要给可选变量取optionalString,maybeView之类的名字;2、不要给绑定变量取real
2014-12-16 09:59:20 524 2
原创 自定义UIPageCrontroll的圆点大小和间距
项目中遇到需要- (void)layoutSubviews{ [super layoutSubviews]; //计算圆点间距 CGFloat marginX = dotW + magrin; //计算整个pageControll的宽度 CGFloat newW = (self.subviews.count - 1 ) * marg
2014-10-21 14:22:41 2317 1
原创 AFNetworking2的SSL身份认证 -1022错误解决办法
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x8d635f0 {NSErrorFailingURLKey=UR}
2014-09-24 01:33:22 1457 1
原创 Xcode插件KSImageNamed添加自定义方法
KSImageNamed是一款方便填写图片文件名称的插件。支持NSImage和UIImage,当你写到[UIImage imaged:的时候,插件会把项目中的图片名称提示出来,并且还有预览功能,对经常用代码生成图片视图的童鞋十分方便。
2014-08-16 11:32:55 428
原创 Presenting view controllers on detached view controllers is discouraged
用 [self.view.window.rootViewControllerpresentViewController:navController animated:YEScompletion:nil];
2014-07-26 10:33:51 342
转载 读取简单的CSV文件
NSString *path = [[NSBundle mainBundle] pathForResource:@"ECG_Data" ofType:@"csv"];NSString *contents = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];NSArr
2014-07-26 10:32:40 368
转载 iOS的四种方法读取文件内容
//第一种方法: NSFileManager实例方法读取数据 NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES); NSString* thepath = [paths lastObject]; thepath
2014-07-26 10:28:47 888
原创 英语词性分类
prep = 介系词;前置词,preposition的缩写 pron = 代名词,pronoun的缩写 n = 名词,noun的缩写 v = 动词,兼指及物动词和不及物动词,verb的缩写 conj = 连接词 ,conjunction的缩写 s = 主词 sc = 主词补语 o = 受词 oc = 受词补语 vi = 不及物动词,intransitive
2014-07-26 10:26:57 534
转载 NSString处理
1NSString *first = @"abdcbabcdbabcbacbcb"; NSString *second = @"cdcdcdcd"; NSString *third = @"string1:string2:string3:string4"; NSArray *strings = [NSArray arrayWithObjects:first,
2014-07-26 10:25:37 258
转载 PPLable 过滤标点方法
- (void)highlightWordContainingCharacterAtIndex:(CFIndex)charIndex { if (charIndex==NSNotFound) { //user did not click on any word [self removeHighlight]; ret
2014-07-24 20:26:27 394
转载 使用Xcode收藏自己常用的代码模板
当你觉得某段代码很有用,可以当作模版的时候,将其整块选中, 拖动到xcode右下角的code snippets区域中即可。xcode会自动帮你创建一个新的代码片段。 之后你可以单击该代码片段,在弹出的界面中选择edit,即可为此代码片段设置快捷键等信息。如果有些地方你想让用户替换掉,可以用 的格式。 这样在代码片段被使用后,焦点会自动移到该处,你只需要连贯的键入替换后的内容即可。如下图所示:
2014-07-24 11:58:07 306
转载 IOS开发之纯代码界面--基本控件使用篇 Demos
http://www.cocoachina.com/bbs/read.php?tid=131516&fpage=3
2014-07-10 00:49:16 316
转载 如何得到自定义UITableViewCell中的按钮所在的cell的indexPath.row
在自定义UITableViewCell中创建了一个按钮。想在点击该按钮时知道该按钮所在的cell在TableView中的行数。就是cell的 indexPath.row两种方法都很好。-(IBAction):(id)sender{ NSLog(@"MyRow:%d",[self.tableindexPathForCell:((TableViewCell*)[[sen
2014-07-10 00:46:44 827
转载 NSArray常用方法
if([yourArray indexOfObject:yourObject] == NSNotFound) { // your object is not in here}
2014-07-10 00:42:37 310
转载 IOS开发的字体大小设置有几种方法
IOS开发的字体大小设置有几种方法:UIFont *font = [UIFont fontWithName:(NSString *)size:(CGFloat)];//字体名,和大小来初始化。UIFont *font = [UIFontfontNamesForFamilyName:(NSString*)];//从设备支持的字体的名字中选择。UIFont *font = [UIFonts
2014-07-10 00:38:39 1270
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人