一、字体加粗
加粗:
[UILabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
加粗并且倾斜:
[UILabel setFont:[UIFont fontWithName:@"Helvetica-BoldOblique" size:20]];
二、NSMutableArray和NSArray的相互转换
// NSArray --> NSMutableArray
NSMutableArray *myMutableArray = [myArray mutableCopy];
// NSMutableArray --> NSArray
NSArray *myArray = [myMutableArray copy];
三、判断图片是否为空
模型复用时,图片内容有时是通过RUL网络获取的,有时是本地的,此时即可作简单
UIImage *image = [UIImage imageNamed:@""];
CGImageRef cgref = [image CGImage];
CIImage *cim = [image CIImage];
if (cim == nil && cgref == NULL){
NSLog(@"no image");
}else{
NSLog(@"imageView has a image");
}
四、暴力暂停方法
[NSThread sleepForTimeInterval:0.5];//暂停0.5s