RestKit/RestKit — pull request #453 by fantasticmf (2011-12-01 16:55:44+00:00)
Title: Bugs related to loading local resource from the bundle

Hello! I made two minor changes to support loading JSON files packaged in the app's resource bundle.

One bug was in RKURL.m where escaped spaces (%20) in URLs were stripped by [NSURL path] and not restored, causing request failures. Obviously this applies to more than just bundle resources, but since bundle resources use "Application%20Support" in their paths, I stumbled across it last night. I added a stringByAddingPercentEscapesUsingEncoding at the end of the completePath building statement, and it restores the escapes.

The other bug was in RKResponse, where local requests for bundle resources returned a NSURLResponse instead of a NSHTTPURLResponse, and therefore doesn't respond to statusCode or allHeaderFields. I added a respondsToSelector: check on the statusCode and allHeaderFields getters.