摘要:
1 协议:协议,类似于Java或C#语言中的接口,它限制了实现类必须拥有哪些方法。它是对对象行为的定义,也是对功能的规范。示例:// GoodChild.h#import @protocol GoodChild -(void)filialPiety;@end// Student.h#import #import "GoodChild.h"//注意实现协议的语法。@interface Student : NSObject@end// Student.m// protocol//// Created by sxt on 11-10-23.// Copyright 2011年 _ 阅读全文
posted @ 2014-01-23 10:36
whu张三
阅读(119)
评论(0)
推荐(0)
摘要:
1.判断邮箱格式是否正确的代码//利用正则表达式验证-(BOOL)isValidateEmail:(NSString *)email{NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES%@",emailRegex];return [emailTest evaluateWithObject:email];}2.图片压 阅读全文
posted @ 2014-01-23 10:28
whu张三
阅读(201)
评论(0)
推荐(0)