1

ASIFormDataRequestでuiprogressバーを表示したいと思います。私はそれをグーグルで検索しましたが、ASIFormDataRequestでuiprogressViewに関して見つけることができません、NSURLConnectionでuiprogressViewを見つけるだけです。可能かどうか教えてください。

//つまり、これはデータをアップロードする私のメソッドです。

-(NSMutableArray*)getUploadVideo:(NSString*)titleName userID:(NSString*)userId token:(NSString*)tokenID description:(NSString*)desc videoID:(NSString*)video_id privateOrPublic:(NSString*)privacyID pathOfVideoFile:(NSString*)path mode:(NSString*)potLand;
{

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://%@/aircastdev/RestServices/fileUpload"],kId];

[request setDelegate:self];

[request setDidFailSelector:@selector(uploadFailed:)];

[request setDidFinishSelector:@selector(uploadFinished:)];

[request setDidFinishSelector:@selector(requestFailed:)];
[request setDidFinishSelector:@selector(requestFinished:)];


[request setPostValue:titleName forKey:@"title"];
[request setPostValue:userId forKey:@"user_id"]; 
[request setPostValue:tokenID forKey:@"token"]; 
[request setPostValue:desc forKey:@"desc"]; 
[request setPostValue:video_id forKey:@"video_id"]; 
[request setPostValue:privacyID forKey:@"is_private"];
[request setPostValue:potLand forKey:@"mode"];

NSString *url = [[NSURL fileURLWithPath:path] path];

[request setFile:url withFileName:[NSString stringWithFormat:@"%@.mov",titleName] andContentType:@"video/MOV" forKey:@"file"];

[request setTimeOutSeconds:50000];
[request setRequestMethod:@"POST"];
// EDITED LINE

[request setUploadProgressDelegate:myProgressView];

[request startSynchronous];

SBJSON *sbJason = [[SBJSON alloc] init];

getUploadArray = [sbJason objectWithString:self.response];

return getUploadArray;


}

//アップロードが完了すると、このメソッド呼び出しが行われます。

- (void)requestFinished:(ASIHTTPRequest *)request
{
// alert: request is successfully sent

 self.response = [request responseString]; //stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];


}
4

1 に答える 1

1

これを使って:

[request setDownloadProgressDelegate:progressView];

また

[request setUploadProgressDelegate:myProgressIndicator];

progressViewUIProgressViewは どこにありますかここもご覧ください

于 2012-12-06T07:57:53.457 に答える