iOS常用的代码块整理

时间:2022-06-07 16:18:11

strong

@property (nonatomic,strong) <#Class#> *<#object#>;

weak

@property (nonatomic,weak) <#Class#> *<#object#>;

copy

@property (nonatomic,copy) NSString *<#string#>;

assign

@property (nonatomic,assign) <#Class#> <#property#>;

block

@property (copy, nonatomic) <#returnType#>(^<#blockName#>)(<#arguments#>);

@property (copy, nonatomic) <#returnType#>(^<#blockName#>)(<#type#> <#name#>)

delegate

@protocol <#delegate#><NSObject>

//方法可实现的

@optional

//方法必须实现

//@required

@end

@property (nonatomic, weak) id <#protocol#> <#delegate#>;

cell

static NSString *cid=<#cid#>;

<#Class#> *cell=[tableView dequeueReusableCellWithIdentifier:cid];

if(cell==nil){

cell=[[<#Class#> alloc] initWithStyle:UITableViewCellStyleDefault      reuseIdentifier:cid];

}

return cell;

//注册Cell


[self.tableView registerNib:[UINib nibWithNibName:<#RegistCell#> bundle:nil] forCellReuseIdentifier:<#RegistCell#>];









-->