摘要: 1-GCDblockblock dispatch_async(dispatch_get_main_queue(), ^{ }); 2-NSOperation NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; NSBlockOper 阅读全文
posted @ 2016-11-16 23:58 华少不思议 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1.判断邮箱格式 -(BOOL)isValidateEmail:(NSString *)email { NSString *emailRegex =@"[A-Z0-9a-z._%+-]+@[A-Za- z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest 阅读全文
posted @ 2016-11-16 23:57 华少不思议 阅读(135) 评论(0) 推荐(0) 编辑
摘要: - (IBAction)uploadButton:(id)sender { UIImage *image = [UIImage imageNamed:@"1.jpg"]; NSData *imageData = UIImageJPEGRepresentation(image, 0.5); NSStr 阅读全文
posted @ 2016-11-16 23:56 华少不思议 阅读(118) 评论(0) 推荐(0) 编辑
摘要: UIImagePickerControllerSourceTypesourceType=UIImagePicker ControllerSourceTypeCamera; if(![UIImagePickerControllerisSourceTypeAvailable:UIImagePick er 阅读全文
posted @ 2016-11-16 23:55 华少不思议 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1.添加导航右侧按钮 UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"无所谓"style:UIBarButtonItemStyleDone target:self action:@selector(cli 阅读全文
posted @ 2016-11-16 23:55 华少不思议 阅读(390) 评论(0) 推荐(0) 编辑
摘要: UIAlertView *theAlert = [[[UIAlertViewalloc] initWithTitle:@"Attention" message:@"I'm a Chinese!"delegate:nilcancelButtonTitle:@"Cancel" otherButtonTi 阅读全文
posted @ 2016-11-16 23:54 华少不思议 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1.设置键盘为无色 textField.keyboardAppearance = UIKeyboardAppearanceAlert; 2.设置状态栏网络风火轮是否显示 [UIApplication sharedApplication].networkActivityIndicatorVisible 阅读全文
posted @ 2016-11-16 23:54 华少不思议 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1.给cell添加选中时的背景图片 UIView *myview = [[UIView alloc] init]; myview.frame = CGRectMake(0, 0, 320, 47); myview.backgroundColor = [UIColor colorWithPattern 阅读全文
posted @ 2016-11-16 23:54 华少不思议 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1、全局异步执行耗时任务 dispatch_async(dispatch_get_global_queue(0, 0), ^{ }); 2.主线程异步刷新UI dispatch_async(dispatch_get_main_queue(), ^{ }); 3.改变PlaceHolder的颜色 [u 阅读全文
posted @ 2016-11-16 23:53 华少不思议 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1.基本概念 进程:操作系统上每一个可以执行的程序。 线程:进程中的任务,必须在线程中执行。 每一个进程,至少包含一个线程,就是我们常说的主线程。 2.任务在线程中的执行 任务在线程中一次一个的依次执行。一个线程同时只能执行一个任务。 如果我们需要同时执行多个任务,就需要多个线程,每次执行一个任务。 阅读全文
posted @ 2016-11-09 12:25 华少不思议 阅读(2032) 评论(0) 推荐(0) 编辑