POST with NSURLConnection - NO JSON

前端 未结 3 911
攒了一身酷
攒了一身酷 2021-02-06 17:35

I am trying to write an iPhone app in Objective-C. I need to POST data using NSURLConnection. Every example I can find deals with JSON; I do not need to use JSON. All I need to

3条回答
  •  星月不相逢
    2021-02-06 18:10

    You can use the following NSURLConnection method if you target ios 2.0 - 4.3 (It seems to be deprecated in ios 5)

    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {
      NSString * string = [[NSString alloc] initWithData:data encoding:
                           NSASCIIStringEncoding];
    
      if (string.intValue == 1) {
    
      } else {
    
      }
    }
    

提交回复
热议问题