Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to install AFNetworking 2.0 with Restkit

I got an news app which fetches news online in XML format in stores it locally in the sqlite dbase.. which is perfect case for restkit.

However, I would like to also fetch xml data manually sometimes (ie and not want to store it in the dbase).. in other words i would like to request it directly with AFNetworking. I like how in AFNetworking 2.0 it does the parsing of xml automatically, and so I want to use that feature.

However, Restkit 2.0 is linked to AFNetworking 1.3.. and so If I add this to my podfile:

pod 'RestKit', '~> 0.21.0'
pod "AFNetworking", "~> 2.0"

and run a pod install I get the following error:

[!] Unable to satisfy the following requirements:
- `AFNetworking (~> 1.3.0)` required by `RestKit/Network (0.21.0)`- `AFNetworking (~> 2.0)` required by `Podfile`

is there anyway around this?

like image 729
abbood Avatar asked Feb 01 '14 10:02

abbood


2 Answers

In version 1.3.0 you have access to AFXMLRequestOperation which should fulfil the same goal.

It would be a lot of work to update RestKit to use version 2.0, or to rename so that you could use both versions...

like image 73
Wain Avatar answered Oct 17 '22 05:10

Wain


A quick and dirty solution could be to just rename the files of afnetworking to af1networking and all the classes/interfaces/constants to AF1xxxx. If we only had namespaces in Objective-C or the AFNetworking guys would have prefixed the new version with AF2...

I think what i describe could be done with a project search and replace in hours.

An Alternative would be to use MKNetworkKit for the networking - it is similiar to afnetworking/afnetworking2 but then you end up having 2 different network libraries and AFNetworking seems to have more effort put into.

like image 25
Christian Kaas Avatar answered Oct 17 '22 06:10

Christian Kaas