iphone 3gsでnsurconnectionを使用して大きなビデオファイルをアップロードしようとしていますが、失敗します。アプリはログなしでクラッシュします。同じコードがiphone4で正常に機能しています。これがメモリ制限の問題であるかどうかを知りたいのですが。3gsは同じコードで小さな動画をアップロードしています。大きなサイズのビデオでのみ失敗します
これが私が使用したコードです:
NSMutableURLRequest *request=[[NSMutableURLRequest alloc]
initWithURL:[NSURL URLWithString: urlString]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:6000.0];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded; boundary=AaB03x" forHTTPHeaderField:@"Content-Type"];
NSLog(@"VideoPathD:%@",videoPathUrl);
NSError *error;
[request setHTTPBody: [NSData dataWithContentsOfURL:videoPathUrl options:0 error:&error]];
[NSURLConnection connectionWithRequest:request delegate:self];