Xcode自定义代码块

标记代码

标题 :Xcode mark
快捷:XcodeMark
内容:
#pragma mark -
#pragma mark - <#descreption#>
设置如下:


屏幕快照 2016-09-14 上午11.45.48.png
OSX tableView Delegate Datasource

标题 :tableView main Delegate Datasourse methods in platform iOS
快捷:tableViewDD
内容:
#pragma mark -
#pragma mark - tableView
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView{
return 1;
}
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row{

return nil;
}
- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row{
/*
 NSTextFieldCell *textCell = cell;
 NSString *identifier = [tableColumn identifier];
 if ([identifier isEqualToString:@"0"]) {
 [textCell setTitle:[NSString stringWithFormat:@"%ld", row + 1]];
 
 }
 else if ([identifier isEqualToString:@"1"]) {
 }
 else if ([identifier isEqualToString:@"2"]) {
 }
 else if ([identifier isEqualToString:@"3"]) {
 }
 else if ([identifier isEqualToString:@"4"]) {
 
 }
 //*/
}
- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row{

/*
 NSString *identifier = [tableColumn identifier];
 
 if ([identifier isEqualToString:@"4"]) {
 
 NSButtonCell * buttonCell = [[NSButtonCell alloc] init] ;
 [buttonCell setBezelStyle:NSRoundedBezelStyle];
 [buttonCell setButtonType:NSMomentaryPushInButton];
 [buttonCell setBordered:NO]; // Don't want a bordered button
 [buttonCell setTitle:@"结束"];
 [buttonCell setAction:@selector(_stop:)];
 return buttonCell;
 }
 // */
return nil;
}

设置如下:

屏幕快照 2016-09-14 上午11.52.01.png

标题 :tableView main Delegate Datasourse methods in platform iOS
快捷:tableViewDD
内容:
#pragma mark -
#pragma mark - tableView
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{

return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

return nil;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

}

设置如下:

屏幕快照 2016-09-14 上午11.56.20.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容