ios programming: Using threads to add multiple images to library

前端 未结 3 1579
鱼传尺愫
鱼传尺愫 2021-01-14 12:21

In Xcode, when I\'m trying to add more than 5 images to my library, it gives me the following error:

Error Domain=ALAssetsLibraryErrorDomain         


        
3条回答
  •  忘掉有多难
    2021-01-14 12:55

    I'd recommend using an NSOperationQueue and play with the value of maxConcurrentOperationCount. This way you can control the number of simultaneous writes to the library, and not overwhelm it.

    If you use threads, or even GCD, you'd need to implement this logic yourself. More code --> more chance of introducing a bug.

提交回复
热议问题