11 2014 档案
摘要:/** * 正则表达式匹配中文 */- (BOOL)isRegexMatching:(NSString *)str;{ NSString *regex = @"^[\u4E00-\u9FFF]+$"; return [[NSPredicate predicateWithFormat:@...
阅读全文
摘要:12.判断邮箱格式是否正确的代码://利用正则表达式验证-(BOOL)isValidateEmail:(NSString *)email{ NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; ...
阅读全文
摘要:-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; CGPoint pt = [touch locationInView:self.view]...
阅读全文
摘要://// UINavigationBar+JTDropShadow.h//// Created by james on 9/20/11.// http://ioscodesnippet.tumblr.com// #import @interface UINavigationBar (JTDr...
阅读全文
摘要://@mg:masksToBounds必须为NO否者阴影没有效果// cell.layer.masksToBounds = NO; cell.layer.contentsScale = [UIScreen mainScreen].scale; cell.layer.shadowOpacity...
阅读全文
摘要:这个属性设置为yes,是为了debug的时候编译速度更快,它只编译当前的architecture版本。而设置为no时,会编译所有的版本。这个是设备对应的architecture:armv6:iPhone 2G/3G,iPod 1G/2Garmv7:iPhone 3GS/4/4s,iPod 3G/4G...
阅读全文
摘要:1、下载ZXingObjc压缩包,解压缩。2、将文件拷贝到项目工程目录下3、到工程目录中ZXingObjc文件夹中将ZXing的执行文件拖拽到项目中。4、点击项目targets ——>Build Phases——>Target Dependencies添加ZXingObjC-iOS(ZXingObj...
阅读全文
摘要:首先在view上添加手势 UIPanGestureRecognizer1 UIPanGestureRecognizer *panGes = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(goAnimation...
阅读全文
摘要:使用空白view取代cell- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //取消选中颜色 UIView *backView = [[...
阅读全文
摘要:- (void)viewDidLoad { [super viewDidLoad]; UIButton *btnTest = [UIButton buttonWithType:UIButtonTypeCustom];//不需要去刻意指定x,y的坐标,可以用CGRectZero ...
阅读全文

浙公网安备 33010602011771号