摘要:
1、创建block用copy修饰,拷贝到堆上 2、之前一直用这种写法,但会碰到提前释放的状态 __weak typeof(self)wakeself = self; 3、就用弱指针指向self,在block内部对weakSelf产生一个强引用,就解决了提前释放的问题 @weakify(self); 阅读全文
摘要:
#pragma mark - 判断字符串是否为空 - (BOOL) isBlankString:(NSString *)string { if (string == nil || string == NULL || [string isEqualToString:@"<null>"]) { retu 阅读全文
摘要:
// // 1.设置请求路径 // NSURL *URL=[NSURL URLWithString:@"http://first.go.com/api/user/serves"];//不需要传递参数 // // NSMutableURLRequest *request = [NSMutableURL 阅读全文
摘要:
passwordTF.keyboardType = UIKeyboardTypePhonePad; 阅读全文
摘要:
registBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 此时文字会紧贴到做边框,可以设置registBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 阅读全文
摘要:
转自http://blog.csdn.net/chuan403082010/article/details/51683309 //昵称 + (BOOL) validateNickname:(NSString *)nickname; //姓名一般只允许包含中文或英文字母 + (BOOL)isValid 阅读全文
摘要:
UIWindow * window = [UIApplication sharedApplication].windows[0]; UIView *backgroundView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT 阅读全文
摘要:
#pragma mark--计算字符串长度 - (CGSize)strsizewithstr:(NSString *)str{ NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:20]}; CGSize 阅读全文
摘要:
UIButton *clearButton = [self.textField valueForKey:@"_clearButton"]; [clearButton setImage:[UIImage imageNamed:@"close"] forState:UIControlStateNorma 阅读全文
摘要:
#define NULLString(string) ((![string isKindOfClass:[NSString class]])||[string isEqualToString:@""] || (string == nil) || [string isEqualToString:@"" 阅读全文