0
WebServiceに何かをアップロードする方法に疑問があります。私は自分のWebサービスから情報を取得するためにこれを使用してきたWebServiceに配列をアップロードする方法
:
NSString * URLString = [NSString stringWithFormat:@"%@%@", kBaseHost, [NSString stringWithFormat:kWSProjectList, token]];
NSURL *url = [NSURL URLWithString:URLString];
NSURLRequest * request = [NSURLRequest requestWithURL:url];
[NSURLConnection sendSynchronousRequest:request inBackgroundWithCompletionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSString *json = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
NSLog(@"%@", json);
NSDictionary * _response = [json JSONValue];
NSLog (@"%@", _response);
NSNotification* notification = [NSNotification notificationWithName:kWSNotificationDidReceiveDataProjectList object:_response];
[[NSNotificationCenter defaultCenter] postNotification:notification];
}];
今、私は反対のことをしなければならない、私は、Webサービスに情報をアップロードする必要があり、私はどのようのないアイデアを持っていません。..誰かが私を少し導くことができましたか?
この方法、sendSynchronousRequestどのようなものです:inBackgroundWithCompletionHandler:私は、ドキュメント内の1つが表示されていない – rdelmar
@interface NSURLConnection(背景) +(無効)sendSynchronousRequest:(NSURLRequest *)要求がinBackgroundWithCompletionHandler:(void(^)(NSURLResponse *、NSData *、NSError *))ハンドラ。 – Marnerk