一、字體加粗
加粗:
[UILabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
加粗并且傾斜:
[UILabel setFont:[UIFont fontWithName:@"Helvetica-BoldOblique" size:20]];
二拇涤、NSMutableArray和NSArray的相互轉(zhuǎn)換
// NSArray --> NSMutableArray
NSMutableArray *myMutableArray = [myArray mutableCopy];
// NSMutableArray --> NSArray
NSArray *myArray = [myMutableArray copy];
三瘤袖、判斷圖片是否為空
模型復(fù)用時(shí),圖片內(nèi)容有時(shí)是通過RUL網(wǎng)絡(luò)獲取的卜录,有時(shí)是本地的戈擒,此時(shí)即可作簡單
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