04 2015 档案
摘要:dispatch_once可以保证代码被执行一次+(NSDateFormatter*)getDBDateFormat{ static NSDateFormatter* format; static dispatch_once_t onceToken; dispatch_once(&...
阅读全文
摘要:1.可以使用定时器进行延迟.- (void) timeEnough{ UIButton *btn=(UIButton*)[self.view viewWithTag:33]; btn.selected=NO;[timer invalidate]; timer=nil;}- (void) btnDon...
阅读全文
摘要:使用Images.xcassets设置启动图片需要注意下面几点:1.将工程中的Launch Screen.xib 文件删除,info.plist中删除 Launch screen interface...选项.2.在target中App Icon and Launch Images中设置 Laun...
阅读全文
摘要:一直在用xcode6开发,但项目都是在xcode5上创建的,所以一直没注意到,xcode6竟然干掉pch文件了。如何在Xcode6中添加pch(Precompile Prefix Header)?1,Command+N,打开新建文件窗口:ios->other->PCH file,创建一个pch文件:...
阅读全文
摘要:在 iOS 7 以及更早之前的版本,MapView 顯示使用者位置不需實作到 CLLocationManager ,現在都要了。在 iOS 8 上編譯會出現以下 log :Trying to start MapKit location updates without prompting for lo...
阅读全文
摘要:补充两个GCD代码,都是Xcode snippet里面提供的:1.Dispatch After主要用于延迟执行一些代码。例子:int64_t delayInSeconds = 1.0;dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW,...
阅读全文
摘要:#import #import "FMDatabase.h"#import "FMDatabaseAdditions.h"@interface wiDBRoot : NSObject@property (retain, nonatomic) FMDatabase *DB;@property (ret...
阅读全文
摘要:/** 在应用委托的方法didFinishLaunchingWithOptions中添加*/[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kRe...
阅读全文

浙公网安备 33010602011771号