Search code examples
iosmailcore2

Mailcore: What does 'urgent' do on MCOOperation?


What does the urgent property do and when should it be used? I'm rendering message summaries but when the user scrolls to a certain position I have to download more messages. This operation doesn't seem to complete until all summaries that I've started rendering have completed. I'm assuming the urgent property would give the message download operation priority over the rendering operation?


Solution

  • The problem for me was how MailCore prioritises operation queues. I need to render summaries so lots of plainTextBodyRenderingOperation are being created (one per message). If the user scrolls to a certain point I need to download more messages. I have to prioritise this over the rendering. So in my download method I set the urgent property on the two operations I run to get the message data. This means as soon as I send a call to download those queues take priority and rendering seems to continue once they are finished. Maybe Hoá can provide more insight but this worked for my situation. I also followed his suggestion in the comments to allow concurrent folder access. That helped too but for me the key was operation priority.