摘要: 大家都知道我们的程序在后台运行的时间是10分钟,10分钟后便会停止。但是像实时定位,播放音频,以及网络电话这些功能我们需要在后台持续运行。那么我们就要进行相应的设置。下面具体的例子以定位为例#import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @interface BackgroundTrackerViewController : UIViewController<CLLocationManagerDelegate> @property(nonatomic, retain) CLLocat 阅读全文
posted @ 2013-01-17 09:59 GreyWolf 阅读(245) 评论(0) 推荐(0) 编辑
摘要: CGFloat BNRTimeBlock (void (^block)(void)) { mach_timebase_info_data_t info; if (mach_timebase_info(&info) != KERN_SUCCESS) return -1.0; uint64_t start = mach_absolute_time (); block (); uint64_t end = mach_absolute_time (); uint64_t elapsed = end - start; uint6... 阅读全文
posted @ 2013-01-17 09:55 GreyWolf 阅读(560) 评论(0) 推荐(0) 编辑