宽容他人,放过自己。

xcode中类懒加载总结

Posted on By anchoriteFili

weak weak
@property (nonatomic,weak) <#hehe#> <#hehe#>;

strong strong
@property (nonatomic,strong) <#hehe#> <#hehe#>;

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

copy copy
@property (nonatomic,copy) <#hehe#> <#hehe#>;

bool panduan
@property (nonatomic,assign) BOOL <#hehe#>;

int zhengshu
@property (nonatomic,assign) int <#hehe#>;

字符串 zifuchuan
@property (nonatomic,strong) NSString *<#hehe#>;

字典 zidian
@property (nonatomic,strong) NSDictionary *<#hehe#>;

可变字典 kbzidian
@property (nonatomic,strong) NSMutableDictionary *<#hehe#>;

数组 shuzu
@property (nonatomic,strong) NSArray *<#hehe#>;

可变数组 kbshuzu
@property (nonatomic,strong) NSMutableArray *<#hehe#>;

view shitu
@property (nonatomic,strong) UIView *<#hehe#>;

label biaoqian
@property (nonatomic,strong) UILabel *<#hehe#>;

imageView tupian
@property (nonatomic,strong) UIImageView *<#hehe#>;

输入框 shurukuang
@property (nonatomic,strong) UITextField *<#hehe#>;

按钮 anniu
@property (nonatomic,strong) UIButton *<#hehe#>;

枚举 meiju
typedef NS_ENUM(NSInteger, <#枚举名字#>) {
    
};

frame初始化 wf
[[<#类名#> alloc] initWithFrame:CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>)];

类初始化allocninit leichushihua
<#类#> *<#自定义名#> = [[<#类#> alloc] init];

添加rect jiarect
CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>)

创建image imageName
[UIImage imageNamed:@"<#hehe#>"]

nslog nslog
NSLog(@"<#hehe#>",<#hehe#>);

hehe hehe
@"<#hehe#>"

cell初始化 initstyle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

注释 zhushi
/**
     <#注释#>
     */

懒加载 lanjiazai
- <#懒加载#> {
    if (<#condition#>) {
        <#statements#>
    }
    return <#expression#>;
}

方法 fangfa
- (void)<#方法#>:<#sender#> {
    
}

按钮方法 anniufangfa
- (void)<#按钮#>:(UIButton *)sender {
    <#method#>
}