大佬教程收集整理的这篇文章主要介绍了iOS Amazon S3 SDK:发送到解除分配的实例的消息,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
*** -[S3PutObjectOperation_Internal respondsToSELEctor:]: message sent to deallocated instance 0x43c18fd0
我不太了解Zombies检查员的堆栈跟踪,我不确定这是否告诉我任何我可以解决的问题:
# Address Category Event Type RefCt timestamp Size Responsible Library Responsible Caller 0 0xc071f60 S3PutObjectOperation_Internal Malloc 1 00:14.903.021 48 MyApp -[S3TransfeRMANager upload:] 1 0xc071f60 S3PutObjectOperation_Internal Retain 2 00:14.903.032 0 Foundation ____addoperations_block_invoke_0 2 0xc071f60 S3PutObjectOperation_Internal Release 1 00:14.903.036 0 MyApp -[S3TransfeRMANager upload:] 3 0xc071f60 S3PutObjectOperation_Internal Retain 2 00:14.904.154 0 libsystem_sim_blocks.dylib _Block_object_assign 4 0xc071f60 S3PutObjectOperation_Internal Retain 3 00:14.904.163 0 libsystem_sim_blocks.dylib _Block_object_assign 5 0xc071f60 S3PutObjectOperation_Internal Release 2 00:14.904.164 0 Foundation __destroy_Helper_block_474 6 0xc071f60 S3PutObjectOperation_Internal Retain 3 00:14.906.549 0 MyApp -[S3PutObjectOperation_Internal start] 7 0xc071f60 S3PutObjectOperation_Internal Release 2 00:14.906.554 0 MyApp -[S3PutObjectOperation_Internal start] 8 0xc071f60 S3PutObjectOperation_Internal Release 1 00:14.907.624 0 MyApp __destroy_Helper_block_ 9 0xc071f60 S3PutObjectOperation_Internal Retain 2 00:15.243.299 0 MyApp -[S3PutObjectOperation_Internal finish] 10 0xc071f60 S3PutObjectOperation_Internal Retain 3 00:15.243.302 0 MyApp -[S3PutObjectOperation_Internal finish] 11 0xc071f60 S3PutObjectOperation_Internal Release 2 00:15.243.307 0 MyApp -[S3PutObjectOperation_Internal finish] 12 0xc071f60 S3PutObjectOperation_Internal Release 1 00:15.243.330 0 MyApp -[S3PutObjectOperation_Internal finish] 13 0xc071f60 S3PutObjectOperation_Internal Release 0 00:15.244.420 0 Foundation __release_object_op 14 0xc071f60 S3PutObjectOperation_Internal Zombie -1 00:15.386.107 0 MyApp -[S3Response connection:didSendBodyData:@R_702_10586@lBytesWritten:@R_702_10586@lBytesExpectedToWrite:]
应用程序上传照片时会发生此错误. Photo对象使用并实现以下方法:
-(void)request:(Amazonservicerequest *)request didSendData:(NSInteger)bytesWritten @R_702_10586@lBytesWritten:(NSInteger)@R_702_10586@lBytesWritten @R_702_10586@lBytesExpectedToWrite:(NSInteger)@R_702_10586@lBytesExpectedToWrite { NSLog(@"didSendData called: %d - %d / %d",bytesWritten,@R_702_10586@lBytesWritten,@R_702_10586@lBytesExpectedToWritE); self.transferProgress += bytesWritten; float p = (float) self.transferProgress / self.uploadSize; self.uploadProgress = [NS@R_450_10793@er @R_450_10793@erWithFloat:p]; } -(void)request:(Amazonservicerequest *)request didCompleteWithResponse:(AmazonserviceResponse *)response { NSLog(@"didCompleteWithResponse called."); } -(void)request:(Amazonservicerequest *)request didFailWithError:(NSError *)error { NSLog(@"didFailWithError called: %@",error); }
我不想禁用所有重试,所以我通过强制不重试服务异常来修复此问题.您可以使用AmazonS3Client的子类来覆盖一个方法,如下所示:
- (BOOL)shouldRetry:(AmazonserviceResponse *)response exception:(NSException *)exception { // There is some kind of bug that is triggered on request retries when S3 requests // return an explicit service exception (e.g.,auth token expired). In these cases // we force no retry to avoid the bug. NSException *exceptionHolder = response.exception; if(exceptionHolder == nil) { exceptionHolder = exception; } if([exceptionHolder isKindOfClass:[AmazonserviceException class]]) { return NO; } return [super shouldRetry:response exception:exception]; }
以上是大佬教程为你收集整理的iOS Amazon S3 SDK:发送到解除分配的实例的消息全部内容,希望文章能够帮你解决iOS Amazon S3 SDK:发送到解除分配的实例的消息所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。