gpt4 book ai didi

iphone - 使用 asihttp 请求在表中发出带有进度条的多个请求

转载 作者:行者123 更新时间:2023-12-03 06:04:59 25 4
gpt4 key购买 nike

我正在使用asihhtp请求在ios中发出多个图像上传请求以将图像提交到服务器。但是我的应用程序总是由于进度条而崩溃。这是我的代码

                ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:urlStr]];
[request appendPostData:postData];
[request setTag:[[dic objectForKey:@"unique"] integerValue]];
[request setDelegate:self];
[request setUploadProgressDelegate:cell.mProgressBar];
[request setDidFailSelector:@selector(requestFail:)];
[request setDidFinishSelector:@selector(requestDone:)];
[request setRequestMethod:@"POST"];
[request addRequestHeader:@"Content-Type" value:@"text/plain"];
[request setShouldContinueWhenAppEntersBackground:YES];
//[myQueue addOperation:request];
[appDelegate window].userInteractionEnabled = NO;
[request startAsynchronous];

我有自定义单元格,其中有进度条和标签,因此一旦流程完成,我就会隐藏进度条并显示已完成的标签。

用户滚动表格应用崩溃使用进度条时出现问题

崩溃输出

> -[UIProgressView respondsToSelector:]: message sent to deallocated instance 0x10d210c0

自定义单元格代码

    #import <UIKit/UIKit.h>

@interface CustomProgressBar : UITableViewCell
{

}

@property (retain, nonatomic) IBOutlet UILabel *mlblCompllrtrlbl;
@property (retain, nonatomic) IBOutlet UIProgressView *mProgressBar;
@property (retain, nonatomic) IBOutlet UIImageView *mCellImafge;

@end

自定义单元格代码

    #import "CustomProgressBar.h"

@implementation CustomProgressBar
@synthesize mlblCompllrtrlbl;
@synthesize mProgressBar;
@synthesize mCellImafge;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

- (void)dealloc
{
[mCellImafge release];
[mlblCompllrtrlbl release];
[mProgressBar release];
[super dealloc];
}

@end

最佳答案

您可能在某处发布了progressview,所以首先删除该语句

[UIProgressView发布];

关于iphone - 使用 asihttp 请求在表中发出带有进度条的多个请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11859608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com