NSURLRequestを使用してHttpリクエストでjsonデータを送信する方法
私はObjective-cを初めて使用し、最近、要求/応答に多大な努力を払い始めています。(http GETを介して)URLを呼び出し、返されたjsonを解析できる実用的な例があります。 この実例は以下の通りです - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [responseData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { NSLog([NSString stringWithFormat:@"Connection failed: %@", [error description]]); } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { [connection release]; //do something with the json that comes back ... (the …