当我在自定义完整处理程序方法中使用NSURLConnection
时。委托方法没有触发。所以我要做的就是让它成功。我想在收到网址时执行操作。
[self exportTo:asset withHandler:^(NSURL *url, NSError *error){
NSLog(@"URL : %@, error: %@", url, error);
NSString *urlString = @"";
// setting up the request object now
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
NSString *boundary = @"---------------------------14737809831466499882746641449";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
NSMutableData *body = [NSMutableData data];
[request setHTTPBody:body];
NSURLConnection *conn=[[NSURLConnection alloc] initWithRequest:request delegate:self];
if (conn)
{
}
else
{
// inform the user that the download could not be made
// NSLog(@"failed to send");
}
}];