关于mailcore2:为什么没有回调邮件,setProgress方法

时间:2015-04-23 16:21:44

标签: ios mailcore2

以下代码:

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方法,你能告诉我吗?谢谢

0 个答案:

没有答案