3

Problem is arrive when i implement post data to server with the use of ASIFormDataRequest library, i have applied Edit>Refactor>Convert to Obj-c Syntax

Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
user3829315
  • 169
  • 2
  • 10

2 Answers2

4

First, you should probably have a plan to get away from ASIHTTPRequest as soon as possible. It's been discontinued since September 2011. If you're starting a new project, you should just switch to something else now. I suggest AFNetworking; there's an introduction here.

If you're trying to maintain an older project, though, read on.

The compiler error you're hitting here is because the ASIHTTPRequest code predates Automatic Reference Counting (ARC), also introduced in 2011. You can read about the ARC transition in Apple's documentation. With ARC, the compiler inserts the equivalent of retain, release and autorelease where appropriate. Calling these functions in code is not allowed.

There are indeed tools to migrate MRR code to ARC, but there's no need to mutate this library. Just set -fno-objc-arc in the Compile Sources build phase for ASIHTTPRequest sources. More details here.

If you're really resurrecting a 2011 or earlier project, though, it's likely that your entire project is not ARC ready. In this case, you can turn off ARC for the entire in target settings; you can find more details on how to do that here.

Again, though, if you're not resurrecting an old project you should probably just use AFNetworking. It's modern, it's active, and it works.

Community
  • 1
  • 1
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
0

With ARC, retain, release and autorelease are inserted by the compiler at the right place. Therefore these messages are not available for the programmer.

Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116