// completionBlock在AFURLConnectionOperation中被手动的设置为nil来打破保留周期。
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-retain-cycles"
self.completionBlock = ^ {
...
};
#pragma clang diagnostic pop
- 2、手机系统时间显示佛教或日本日历后,显示时间错误问题
#ifdef __IPHONE_8_0
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];//根据Identifer获取公历
#else
calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];//根据Identifer获取公历
#endif
calendar.timeZone = [NSTimeZone localTimeZone];//消除时区差异
calendar.locale = [NSLocale currentLocale];//消除本地化差异,本地化包括语言、表示的日期格式等
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
formatter.calendar = calendar;
static pthread_mutex_t _sharedDebugLock;
pthread_mutex_lock(&_sharedDebugLock);
...
pthread_mutex_unlock(&_sharedDebugLock);
dispatch_semaphore_t framesLock = dispatch_semaphore_create(1);
dispatch_semaphore_wait(framesLock, DISPATCH_TIME_FOREVER);
...
dispatch_semaphore_signal(framesLock);
__weak typeof(self) weakSelf = self;
self.testObject.testCircleBlock = ^{
__strong typeof (weakSelf) strongSelf = weakSelf;
[strongSelf doSomething];
};
网友评论