0
我對如何將某些內容上傳到WebService存在一些懷疑。如何將數組上傳到WebService
我一直在使用這個從我的web服務獲得信息:
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];
}];
現在我要做相反的,我已經上傳信息到WebService的,我不知道該怎樣想法..有人可以指導我一點嗎?
這是什麼方法,sendSynchronousRequest:inBackgroundWithCompletionHandler:我沒有看到一個在文檔 – rdelmar 2012-03-30 18:44:45
@interface NSURLConnection的(背景) +(無效)sendSynchronousRequest:(*的NSURLRequest)請求inBackgroundWithCompletionHandler:(void(^)(NSURLResponse *,NSData *,NSError *))handler; – Marnerk 2012-04-03 17:19:10