问题
Is it possible to run multiple operations simultaneously? I'm downloading emails in the background through an operation. When my users open an email to view it I start another operation to get the message - this doesn't run until the downloading operations are complete.
回答1:
You can adjust the property allowsFolderConcurrentAccessEnabled
if you think you're always be on a server that supports it.
Additionally, when you fetch a message, you can use a urgent
flag to tell if you need to fetch it as soon as possible. It will make operation run simultaneously.
- (MCOIMAPFetchContentOperation *) fetchMessageOperationWithFolder:(NSString *)folder
uid:(uint32_t)uid
urgent:(BOOL)urgent;
来源:https://stackoverflow.com/questions/27904639/running-simultaneous-operations-in-mailcore2