随笔分类 -  IOS开发

摘要:Version,通常说的版本号,是应用向用户宣传说明时候用到的标识。一般有2段式或者3段式,例如:2.1,8.1.2Version一般由产品部门确定,完全迥异的更新需要改变主版本号,比如QQ4.0的变化非常大,主版本的变化会更加吸引用户的眼球,所以有的应用会频繁的更新主版本号,比如FireFox 2... 阅读全文
posted @ 2015-01-12 11:43 糊涂人 阅读(1347) 评论(0) 推荐(0)
摘要:1、将运行目标选为iOS Device2、Edit Scheme -> 选择 Run [App Name] -> Build Configuration下拉框中选择Release3、生成编译文件,Product -> Build4、/Users/用户名/Library/Developer/Xcode... 阅读全文
posted @ 2015-01-08 18:36 糊涂人 阅读(1534) 评论(0) 推荐(0)
摘要:1 - (void)applicationDidEnterBackgtound 2 { 3 UIApplication *app = [UIApplication sharedApplication]; 4 __block UIBackgroundTaskIdentifier ta... 阅读全文
posted @ 2014-12-29 11:54 糊涂人 阅读(323) 评论(0) 推荐(0)
摘要:1 You can also use %zd (NSInteger) and %tu (NSUInteger) when logging to the console.2 3 NSInteger integer = 1;4 NSLog(@"first number: %zd", integer);5... 阅读全文
posted @ 2014-12-17 13:07 糊涂人 阅读(1543) 评论(0) 推荐(0)
摘要:double radians(double degrees){ return degrees * M_PI / 180.0;}- (void)testDistance{ FMDatabase *db = [FMDatabase databaseWithPath:_writableDBPa... 阅读全文
posted @ 2014-12-05 17:53 糊涂人 阅读(448) 评论(0) 推荐(0)
摘要:You can implement your own functions in SQLite. For example, write a SQLite C function wrapper foracos:void sqlite_acos(sqlite3_context *context, int ... 阅读全文
posted @ 2014-12-05 14:54 糊涂人 阅读(1119) 评论(0) 推荐(0)
摘要:Distance function for sqlitePosted onOctober 25, 2008byDaveAs part of an iPhone SDK project, I have an sqlite database with a table full of geographic... 阅读全文
posted @ 2014-12-05 14:53 糊涂人 阅读(587) 评论(0) 推荐(0)
摘要:mysql经纬度查询并且计算2KM范围内附近用户的sql查询性能优化实例教程之前很傻很天真地以为无非就是逐个计算距离,然后比较出来就行了,然后当碰到访问用户很多,而且数据库中经纬度信息很多的时候,计算量的迅速增长,能让服务器完全傻逼掉,还是老前辈的经验比我们丰富,给了我很大的启示。MySQL性能调优... 阅读全文
posted @ 2014-12-05 14:02 糊涂人 阅读(9595) 评论(0) 推荐(0)
摘要:1 #import 2 3 @interface MAMapView (ZoomLevel) 4 - (NSUInteger)getZoomLevel; 5 6 - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordin... 阅读全文
posted @ 2014-12-02 10:21 糊涂人 阅读(4045) 评论(0) 推荐(0)
摘要:/** * 正则表达式匹配中文 */- (BOOL)isRegexMatching:(NSString *)str;{ NSString *regex = @"^[\u4E00-\u9FFF]+$"; return [[NSPredicate predicateWithFormat:@... 阅读全文
posted @ 2014-11-25 16:17 糊涂人 阅读(332) 评论(0) 推荐(0)
摘要:12.判断邮箱格式是否正确的代码://利用正则表达式验证-(BOOL)isValidateEmail:(NSString *)email{ NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; ... 阅读全文
posted @ 2014-11-25 12:51 糊涂人 阅读(497) 评论(0) 推荐(0)
摘要:-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; CGPoint pt = [touch locationInView:self.view]... 阅读全文
posted @ 2014-11-12 18:56 糊涂人 阅读(842) 评论(0) 推荐(0)
摘要://// UINavigationBar+JTDropShadow.h//// Created by james on 9/20/11.// http://ioscodesnippet.tumblr.com// #import @interface UINavigationBar (JTDr... 阅读全文
posted @ 2014-11-12 15:51 糊涂人 阅读(1245) 评论(0) 推荐(0)
摘要://@mg:masksToBounds必须为NO否者阴影没有效果// cell.layer.masksToBounds = NO; cell.layer.contentsScale = [UIScreen mainScreen].scale; cell.layer.shadowOpacity... 阅读全文
posted @ 2014-11-12 15:42 糊涂人 阅读(345) 评论(0) 推荐(0)
摘要:这个属性设置为yes,是为了debug的时候编译速度更快,它只编译当前的architecture版本。而设置为no时,会编译所有的版本。这个是设备对应的architecture:armv6:iPhone 2G/3G,iPod 1G/2Garmv7:iPhone 3GS/4/4s,iPod 3G/4G... 阅读全文
posted @ 2014-11-12 13:33 糊涂人 阅读(209) 评论(0) 推荐(0)
摘要:1、下载ZXingObjc压缩包,解压缩。2、将文件拷贝到项目工程目录下3、到工程目录中ZXingObjc文件夹中将ZXing的执行文件拖拽到项目中。4、点击项目targets ——>Build Phases——>Target Dependencies添加ZXingObjC-iOS(ZXingObj... 阅读全文
posted @ 2014-11-12 11:26 糊涂人 阅读(1401) 评论(0) 推荐(0)
摘要:首先在view上添加手势 UIPanGestureRecognizer1 UIPanGestureRecognizer *panGes = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(goAnimation... 阅读全文
posted @ 2014-11-12 00:01 糊涂人 阅读(420) 评论(0) 推荐(0)
摘要:使用空白view取代cell- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //取消选中颜色 UIView *backView = [[... 阅读全文
posted @ 2014-11-10 15:05 糊涂人 阅读(545) 评论(0) 推荐(0)
摘要:- (void)viewDidLoad { [super viewDidLoad]; UIButton *btnTest = [UIButton buttonWithType:UIButtonTypeCustom];//不需要去刻意指定x,y的坐标,可以用CGRectZero ... 阅读全文
posted @ 2014-11-01 14:57 糊涂人 阅读(1150) 评论(1) 推荐(1)
摘要://// BMDefineUtils.h// Sensoro Configuration Utility// @discussion 常用宏定义// Created by skyming on 14-4-15.// Copyright (c) 2014年 Sensoro. All righ... 阅读全文
posted @ 2014-10-31 12:06 糊涂人 阅读(271) 评论(0) 推荐(0)