我在ios swift中捕获图像并尝试在后台任务中保存图像和缩略图
使用此代码
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")
})
})
它可以正常工作4次,之后它甚至没有达到商店图像功能。我在做什么错误?