私のアプリケーションでは、FbConnect を使用して Facebook ウォールにビデオをアップロードしようとしていますが、私のコードは問題ないように見えますが、ビデオがアップロードされない理由がわかりません。画像のアップロードに使用するコードです
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"2" ofType:@"png"];
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfFile:filePath];
UIImage *img = [[UIImage alloc] initWithData:data];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
img, @"Picture",
nil];
[_facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
[img release];
そしてビデオのために私はこのコードを試しています
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"myVideo" ofType:@"mp4"];
NSURL *url = [NSURL URLWithString:filePath];
NSData *videoData = [NSData dataWithContentsOfURL:url];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, @"video.mp4",
@"video/quicktime", @"contentType",
@"Video Test Title", @"title",
@"Video Test Description", @"description",
nil];
[_facebook requestWithGraphPath:@"me/videos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
上記のコードではエラーは発生しませんが、ラベルにテキストメッセージが返されます(操作を完了できませんでした)。これは画像のアップロードの場合ではありません。修正方法を教えてください。