以下代码:
MCOIMAPMessagesRequestKind requestKind = MCOIMAPMessagesRequestKindHeaders;
NSString *folder = @"INBOX";
MCOIndexSet *uids = [MCOIndexSet indexSetWithRange:MCORangeMake(1, 10)];
MCOIMAPFetchMessagesOperation *fetchOperation = [self.session fetchMessagesOperationWithFolder:folder requestKind:requestKind uids:uids];
[fetchOperation setProgress:^(unsigned int current) {
NSLog(@"%ui",current);
}];
[fetchOperation start:^(NSError * error, NSArray * fetchedMessages, MCOIndexSet * vanishedMessages) {
//We've finished downloading the messages!
//Let's check if there was an error:
if(error) {
NSLog(@"Error downloading message headers:%@", error);
}
double deltaTime = [[NSDate date] timeIntervalSinceDate:tmpStartData];
NSLog(@"cost time = %f", deltaTime);
//And, let's print out the messages...
NSLog(@"The post man delivereth:%lu", fetchedMessages.count);
}];
为什么没有回调setProgress方法,你能告诉我吗?谢谢