zoukankan      html  css  js  c++  java
  • Xcode 快速开发 代码块 快捷键

    Xcode的代码片段(Code Snippets)创建自定义的代码片段,当你重用这些代码片段时,会给你带来很大的方便。

    常用的:

    1.strong:
    @property (nonatomic,strong) <#Class#> *<#object#>;
    2.weak:
    @property (nonatomic,weak) <#Class#> *<#object#>;
    3.copy:
    @property (nonatomic,copy) NSString *<#string#>;
    4.assign:
    @property (nonatomic,assign) <#Class#> <#property#>;
    5.delegate:
    @property (nonatomic,weak) id<<#protocol#>> <#delegate#>;
    6.block:
    @property (nonatomic,copy) <#Block#> <#block#>;
    7.mark:
    #pragma mark <#mark#>
    8.ReUseCell:

    static NSString *rid=<#rid#>;  
    <#Class#> *cell=[tableView dequeueReusableCellWithIdentifier:rid];  
    
     if(cell==nil){  
    
     cell=[[<#Class#> alloc] initWithStyle:UITableViewCellStyleDefault      reuseIdentifier:rid];  
    
     }  
    
     return cell;

    9.MainGCD:

    dispatch_async(dispatch_get_main_queue(), ^{  
    <#code#>  
      });

    10.AfterGCD:

     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(<#delayInSeconds#> * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{  
    <#code to be executed after a specified delay#>  
    });

    11.OnceGCD:

     static dispatch_once_t onceToken;  
     dispatch_once(&onceToken, ^{  
    <#code to be executed once#>  
     });
  • 相关阅读:
    CF1202F You Are Given Some Letters...
    CF1178E Archaeology
    PTA (Advanced Level) 1005 Spell It Right
    PTA (Advanced Level) 1004 Counting Leaves
    Qt5——从零开始的Hello World教程(Qt Creator)
    PTA (Advanced Level) 1003 Emergency
    PTA (Advanced Level) 1002 A+B for Polynomials
    HDU 1272 小希的迷宫
    FZU 2150 Fire Game
    HihoCoder
  • 原文地址:https://www.cnblogs.com/liaolijun/p/7562318.html
Copyright © 2011-2022 走看看