我的情况是我需要等到方法被执行然后才继续执行我已经尝试过 cfrunlooprun 和
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(queue, ^{
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error)
{
但这对我没有帮助我的代码在下面
- (NSArray*) calendarMonthView:(TKCalendarMonthView*)monthView marksFromDate:(NSDate*)startDate
toDate:(NSDate*)lastDate{
[self fatchAllEvent];// this method contain block it takes 1 second to get executed and events array get filled from that block
NSLog(@"all event %@",events); it shows null here cuse blocked has not executed yet
[self generateRandomDataForStartDate:startDate endDate:lastDate]; this method need events array but as there is no data so nothing happens
return self.dataArray;
}
我怎么能等到 fatchAllEvent 方法被执行,然后只有在执行处理之后