摘要: 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 华少不思议 阅读(391) 评论(0) 推荐(0) 编辑
摘要: UIAlertView *theAlert = [[[UIAlertViewalloc] initWithTitle:@"Attention" message:@"I'm a Chinese!"delegate:nilcancelButtonTitle:@"Cancel" otherButtonTi 阅读全文
posted @ 2016-11-16 23:54 华少不思议 阅读(147) 评论(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 华少不思议 阅读(265) 评论(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) 编辑