当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - dispatch_async not working properly

问题描述:

i am capturing image in ios swift and try to save image and thumbnail image in background task

using this code

 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {

var imageSaveCall = self.storeReceiptImageToFile(imageToSave,fileName:fileName)

dispatch_async(dispatch_get_main_queue(), {

println("Raw image saved")

})

})

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {

var imageSaveCall = self.storeReceiptThumbImageToFile(imageToSave,fileName:fileName)

dispatch_async(dispatch_get_main_queue(), {

println("thumb image saved")

})

})

it is working fine up to 4 time, after that it not even hitting the store image function. is there any mistake i am doing?

分享给朋友:
您可能感兴趣的文章:
随机阅读: