- 博客(15)
- 资源 (5)
- 收藏
- 关注
原创 ios 常用的正则表达式
//正则匹配用户密码6-20位数字和字母组合+ (BOOL)checkPassword:(NSString *) password{ NSString *pattern =@"(\\w|\\W){6,20}"; NSPredicate *pred = [NSPredicatepredicateWithFormat:@"SELF MATCHES %@", pattern]...
2015-07-29 16:07:16 298
原创 ios 解决键盘挡住输入框的问题
//注册隐藏键盘通知[[NSNotificationCenterdefaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name: UIKeyboardWillHideNotificationobject: nil]
2015-07-29 15:58:02 305
原创 ios 使用GCD控制 发送短信 按钮时间间隔
// 触发事件- (void)startTime{ dispatch_queue_t queue =dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0); dispatch_source_t _timer =dispatch_source_create(DISPATCH_SOURCE_TYP
2015-07-29 15:50:36 465
原创 ios coreData 根据应用版本升级进行更新
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator{ if (_persistentStoreCoordinator !=nil) { return_persistentStoreCoordinator; } NSURL *storeURL = [[self
2015-07-29 15:32:15 363
原创 ios 根据总数和列数 计算显示行数
int totalCount = mvArray.count;//总条数 int pageCnt =6;//每一页填满的个数 int pageSize;//页数 int a = totalCount % pageCnt;//总数 % 行的个数 =余数 是否等于0判断是否换段 if (a ==0) {
2015-07-29 15:25:09 3064
原创 UILable 设置对齐方式扩展
typedefenum VerticalAlignment { VerticalAlignmentTop, VerticalAlignmentMiddle, VerticalAlignmentBottom,} VerticalAlignment;@interface MKLabel :UILabel{ @private Ve
2015-07-29 15:17:15 344
原创 ios 常用的处理沙盒文件方法
@implementation FileOperate// 获取沙盒主目录路径+ (NSString *)getFileRootPathAtObjects{ NSString *homeDir =NSHomeDirectory(); if (homeDir && ![homeDirisEqualToString:@""]) {
2015-07-29 15:14:57 436
原创 iOS UITableView 中局部刷新实现方式
1.根据NSIndexSet 中 initWithIndex 方法刷新具体某SectionNSIndexSet * indexSet = [[NSIndexSetalloc] initWithIndex:0];//刷新第一个section[_tableViewreloadSections:indexSet withRowAnimation:UITableViewRowAnim
2015-07-24 14:46:45 538
原创 iOS 实现百度LBS定位
1. 首先在info.plist 文件中添加一个属性值NSLocationAlwaysUsageDescription2.实现 BMKLocationServiceDelegate,BMKGeoCodeSearchDelegate 这两个代理方法@interfaceMKLocationManager()- (void)getCurrentLoc
2015-07-24 14:26:19 477
原创 iOS 中 Block实现UIAlertView
#import "MKAlertView.h"#import static constNSString *UIALERTVIEW_CLICKED_KEY =@"UIAlertView_Clicked_Key";@implementation MKAlertView//代理并实现alertView代理方法- (void)handlerClicked
2015-07-24 14:10:32 306
原创 ios NSDateComponents 时间计算方法
// 计算当前相隔多少天以后的日期NSDateComponents *comps = [[NSDateComponentsalloc] init];[comps setDay:1];NSCalendar *calender = [[NSCalendaralloc] initWithCalendarIdentifier:NSGregorianCalendar];NSDat
2015-07-21 14:32:59 956
原创 ios 常用的宏定义方法
#define IOS5 ([[[UIDevice currentDevice] systemVersion] floatValue] <6.0)#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]#define CurrentSystemVersion ([[UIDevice cur
2015-07-21 14:05:25 603
原创 swift 使用MAGearRefreshControl控件刷新
class ThridViewController:UIViewController, UITableViewDataSource,UITableViewDelegate,MAGearRefreshDelegate { var _tableView:UITableView! var refreshControlView:MAGearRefreshContro
2015-07-17 15:27:27 448
原创 swift 中navigationBar颜色设置
overridefunc viewWillAppear(animated: Bool) { super.viewWillAppear(animated) var nav =self.navigationController?.navigationBar nav?.barStyle =UIBarStyle.Black
2015-07-17 15:20:03 475
原创 Swift 中UITabBarController使用方法
class AppDelegate:UIResponder,UIApplicationDelegate,UITabBarControllerDelegate { var window:UIWindow? var navgationView1:UINavigationController! var navgationView2:UINavigationControl...
2015-07-17 15:07:21 621
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人