mardi 4 août 2015

AFNetworking 2.0 POST issue | replacing deprecated multipartFormRequestWithMethod:path:parameters

I am migrating an iOS app from Xcode4 to Xcode7 (beta 4). Dependency to AFNetworking is automatically resolved via Pods. AFNetworking 2.0 is not backwards compatible with AFNetworking 1.0 so I modified part of the source. Here is

  • File structure
  • Log and
  • the related Source code

Issue below

/Api/ApiClient.m::: error: unexpected interface name 'NSData': expected expression
                NSData* callerData = [@"http://nikyotis.xyz" dataUsingEncoding:NSUTF8StringEncoding];
                ^

/Api/ApiClient.m::: error: use of undeclared identifier 'callerData'
                NSData* callerData = [@"http://nikyotis.xyz" dataUsingEncoding:NSUTF8StringEncoding];

at line 280 of the example above

enter image description here

Substituting NSData with NSString results in the error below

enter image description here

Original AFNetwork-1.0 code below

enter image description here

I try to migrate to AFNetwork-2.0 by replacing the routine with either //1

enter image description here

or //2

enter image description here

without any success



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire