UIImageWriteToSavedPhotosAlbum saves only 5 image out of 10. Why?

后端 未结 2 442
温柔的废话
温柔的废话 2021-01-03 14:46

I have the problem as the title goes. Are there any restrictions, like \"Export only 3 image per second\", or something like?

        for (int frameStepper =         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 15:21

    If I log the error of completion, it says:

    Error Domain=ALAssetsLibraryErrorDomain Code=-3301 "Write busy" UserInfo=0x69e8e20 {NSLocalizedFailureReason=There was a problem writing this asset because the writing resources are busy., NSLocalizedRecoverySuggestion=Try to write again, NSLocalizedDescription=Write busy}
    

    That means I have to wait for the completition of the running processes by implementing the given callback:

    - (void)               image: (UIImage *) image
        didFinishSavingWithError: (NSError *) error
                     contextInfo: (void *) contextInfo
    

    Hurray.

提交回复
热议问题