Jeremy Ellison
eea75bdb3c
Allow Timeout caching and ETag caching to play nice with each other. Update the internal cache date when we get a 304 back.
2011-06-30 12:54:03 -04:00
Blake Watters
7053a8ca97
Add support for sending objects of one type and getting back another. Target object has been disambiguated into sourceObject and targetObject
...
and act independently with regards to serialization and destination mapping. When you leverage the getObject:mapResponseWith: flavor of methods,
the type of your sourceObject is checked with the destination type of the object mapping. If they agree, it is assumed that you are trying to update
the object with the results of the mapping and targetObject is set appropriately. If they do not match, the targetObject is set to nil so that new
objects will be loaded. closes #161 , #168
2011-06-30 10:33:39 -04:00
Blake Watters
2ac45f5ccc
Refactored object loaders to provide easier support for non-nested JSON responses. There are new flavors of getObject:, postObject:, etc.
...
that allow the developer to explicitly specify the object mapping to use for processing the response. closes #168
2011-06-30 10:33:39 -04:00
Blake Watters
2e7adbdc1e
Restore the managed object cache functionality and add test coverage so it does not break again. fixes #167
2011-06-29 22:08:35 -04:00
Blake Watters
5a2f937a52
Reworked notifications for consistency with Cocoa idioms. Simplified code paths through the queue. Tweaked the logging for easier info at the Debug level without having to drop down to Trace.
2011-06-29 16:18:18 -04:00
Blake Watters
853704b2fd
Rework notifications to allow request queue to observe only the requests it dispatches instead of all of them. Fixes incorrectly decrementing loading count.
2011-06-29 15:36:10 -04:00
Blake Watters
851df3bcba
Changed signature of willMapData: to allow you to completely replace the mappableData.
2011-06-28 11:46:03 -04:00
Blake Watters
0949337749
Allow modification of the data in objectLoader:willMapData: by creating a mutable copy of the parsed data if the delegate method is implemented.
2011-06-27 16:37:55 -04:00
Blake Watters
8ad1a84281
Reworked object loader to check if a response is mappable even if it is an error. We had an assertion failure that could be triggered by trying to load a remote error payload in a non-mappable format (i.e. text/html).
2011-06-21 13:27:15 -04:00
Blake Watters
3204682f72
Added object mapping management to the mapping provider for folks who don't have keyPaths. Deprecated setMapping:forKeyPath: in favor of setObjectMapping:forKeyPath: for consistency with the other method signatures.
2011-06-20 10:49:40 -04:00
Victor Kryukov
00ee7e93c3
Code cleanup: **error may be null as per coding standards in 'Creating and Returning NSError Objects' (found with Analyzer)
2011-06-20 10:49:39 -04:00
Jeremy Ellison
de684989db
Fix memory leaks in -reset on RKObjectLoader and RKManagedObjectLoader.
2011-06-20 09:12:56 -04:00
Daniel Hammond
d9fc311433
Remove objects persisted to Core Dataduring postObject: when there is an error (Fix Issue #125 )
2011-06-16 21:17:14 -04:00
Blake Watters
9299cabc11
Implemented flexible logging solution utilizing the excellent LibComponentLogging library.
2011-06-11 20:25:28 -04:00
Blake Watters
f2ceefa012
Merge Request Queue (See issue #75 ):
...
* Introduces RKRequestCache for cacheing responses (supports ETag conditional GET, use cache if available, use cache on error, etc.) closes #75
* Updates to Three20 layer to eliminate need for intermediary TTTableItem classes closes #76
* Fixes to ensure iOS 3.x compatability:
* Switched compiler to Clang
* Updated conditional checks for UIBackgroundTask symbols to ensure runtime safety on iOS 3.x
* Removed unnecessary linkage against UIKit and CoreFoundation from library targets
* Fix for issue where RKRequest objects could become stuck in infinite loop within RKRequestQueue loadNextInQueue if you start
a request and then cancel immediately. On cancel only decrement loadCount if the request has start loading. refs #122
2011-06-11 19:28:44 -04:00
Blake Watters
f3c0995d5e
Implementation of Object Mapping 2.0 design:
...
* Removed RestKit from inheritance hierarchy
* Mappings are implemented as concrete classes
* Mapper is much more flexible & powerful
* Much more robust error handling
* Serialization is reimplemented as an object mapping operation
* Added ability to serialize to JSON natively
* Reworked Core Data integration
* Simplified the codebase substantially
2011-06-11 19:26:56 -04:00
Pat Shields
eecf87e71a
Don't leak object passed in to loader.
2011-05-27 12:46:36 -04:00
Blake Watters
4321da03b1
Expanded specs and began migrating all the content for testing out in the Fixtures directory. Fixtures is now the root for the Sinatra app and there are new helpers in RKSpecEnvironment.m. Added specs for several users use cases from the mailing list. Introduced a new warning when attempting to map did not set any properties.
2011-05-02 20:57:18 -04:00
Blake Watters
87d0cd13de
Added support for registering object class mappings as keyPaths in addition to element names. closes #82
2011-04-28 13:09:50 -04:00
Blake Watters
308b6c5dd2
Updates to RKObjectLoader to fix issues where keyPath was not always respected and willSendForObjectLoader: not invoked as expected. Expanded spec coverage to fix these issues. fixes #80 , fixes #81
2011-04-28 00:05:55 -04:00
Andrew Newdel
e277e636f8
Add a modified handleTargetObject implementation from RKManagedObjectLoader to give RKObject a chance to respond to willSendWithObjectLoader.
2011-04-21 19:32:29 -04:00
Andrew Newdel
bbce5abfd4
Use the keyPath property to map a subset of the response for a single target object.
2011-04-21 19:24:41 -04:00
Blake Watters
9af6a59c79
Initial implementation of documentation generation using the Appledoc parser. refs #48
...
* Cleaned up various mismatches in method signatures that were preventing documentation generation
* Removed naked ampersands from comments as they cause XML parser failures during docset generation via appledoc
2011-04-14 22:55:58 -04:00
Blake Watters
9593612aab
Closes gh-47. Initial implementation of OS X build integrating changes submitted by Felix Holmgren ( https://github.com/Felixyz/RestKit ).
...
* Factored out display of alerts into RKAlert interface that hides the differences between UIKit and OS X Cocoa.
* Added macosx to supported platforms to enable build on OS X.
* Configured project to use conditional architectures to enable building on OS X and iOS from the same targets.
* Implemented a bare-bones OS X example app.
* Create `rake build` task for building RestKit against iOS and OS X SDK for quick testing.
2011-04-12 21:02:25 -04:00
Blake Watters
9dcd7f3022
Removed superclass call to didFinishLoad: in RKObjectLoader. Was resulting in duplicated dispatch of life-cycle requests. Fixes #44
2011-04-12 19:11:31 -04:00
Blake Watters
a648d26460
[ #11477593 ] Implemented background request policies and Specs. This provides functionality for continuing a request in the background using an iOS background task.
...
Introduces four modes for handling background requests:
* RKRequestBackgroundPolicyNone - The default behavior replicating pre-background behavior. No special action is taken with regards to backgrounding.
* RKRequestBackgroundPolicyCancel - On transition to the background, requests with this policy set will be cancelled automatically and the delegate informed.
* RKRequestBackgroundPolicyContinue - Requests with this policy will be continued in the background after the app has been transitioned.
* RKRequestBackgroundPolicyRequeue - Requests with this policy will be cancelled and then immediately placed onto the queue for processing the next time the app is returned to the foreground.
2011-04-05 13:06:06 -04:00
Blake Watters
c90ec2770d
Finished cleanup of HTTP AUTH and XML Support. Ready to tag 0.9.1
2011-03-28 23:29:06 -04:00
Blake Watters
69c051a57a
Aligned target name with JSON parsers
2011-03-27 23:05:24 -04:00
Blake Watters
a298bc4dcf
Fix build problems
2011-03-27 22:53:08 -04:00
Blake Watters
227f35a20d
Merge branch '0.9' into xml-parser
...
Conflicts:
Examples/RKTwitter/Classes/RKTwitterViewController.m
README.md
RestKit.xcodeproj/project.pbxproj
2011-03-27 22:29:19 -04:00
Blake Watters
2109fae1ba
Finished cleaning up Core Data support. Happy with the new organization
2011-03-19 22:06:51 -04:00
Blake Watters
88a1b013fc
Merge remote branch 'origin/0.9' into core-data-cleanup
...
Conflicts:
Code/CoreData/CoreData.h
Code/CoreData/RKManagedObjectStore.h
Code/CoreData/RKManagedObjectStore.m
Code/CoreData/RKObjectSeeder.h
Code/CoreData/RKObjectSeeder.m
Code/ObjectMapping/RKObjectLoader.m
Code/ObjectMapping/RKObjectManager.m
Code/ObjectMapping/RKObjectMapper.m
RestKit.xcodeproj/project.pbxproj
2011-03-19 21:26:13 -04:00
Jeremy Ellison
bc482efd31
Working XML Support. Twitter example working (XML and JSON)
2011-03-01 13:54:00 -05:00
Blake Watters
e03c6d3d10
Fixed crash during dealloc of RKClient due to initialization of baseURL observer using a blank host. Updated the object mapper to support class/keypath when loading a single object. Some updates to the UISpec harness to get things working again.
2011-02-25 14:42:50 -05:00
Blake Watters
3467ac5d49
DiscussionBoard and RKTwitter now build properly. May fold the code back out of RKManagedObjectLoader tomorrow.
2011-02-13 02:19:53 -05:00
Blake Watters
f83dc271f9
Finished cleaning up dependencies on Core Data. RKTwitter now builds without linking against Core Data or libRKCoreData.a
2011-02-13 02:04:51 -05:00
Blake Watters
b9e4f57fb0
Work in progress factoring Core Data dependencies out of the Object Mapping layer
2011-02-13 01:19:37 -05:00
Blake Watters
39a77057ed
Removed saveObjectStore method on RKObjectManager, step toward separating Core Data from the base object mapping. RKObjectLoader now ensures that the object store is persisted appropriately before object loaders are sent
2011-01-21 00:56:17 -05:00
Blake Watters
07796df253
Refactored the Rails router to respect properties specified by the model objects. Introduced new support to allow models to modify RESTful object loaders just before they are sent. Sample app completely works. Really fucking happy with how this is turning out!
2011-01-21 00:15:02 -05:00
Jeremy Ellison
ac53cf9f2e
Always return an NSManagedObjectContext from the NSThreadDictionary. Do not bless the one on the main thread. Ensure merges happen on the main thread.
...
Clean up error alert because of removal of goOffline support (as it was broken).
2011-01-13 14:33:28 -05:00
Jeremy Ellison
471a4ad137
RKObjectLoader should be set up with the object managers client, not the shared one.
...
This fixes support for apps using multiple baseURLs via multiple clients or managers.
2011-01-13 13:41:52 -05:00
Jeremy Ellison
6a5ee2af7e
Revert "Remove per-file copyrights"
...
This reverts commit 91e7c6bb5e .
2011-01-12 15:27:19 -05:00
Jeremy Ellison
91e7c6bb5e
Remove per-file copyrights
2011-01-12 15:05:22 -05:00
Jeremy Ellison
a4c3fc9dae
Merge branch 'master' of github.com:twotoasters/RestKit
2011-01-06 15:48:31 -05:00
Jeremy Ellison
f690fa19f3
The RKRailsRouter no longer sends params with delete requests.
...
The RKObjectLoader will now clean up deleted objects inside of processLoadModelsInBackground:
2011-01-06 15:47:09 -05:00
Jeff Arena
88489747e8
add additional response convenience method for checking for a 503 response code; quiet a compiler warning regarding depracated client class method; add default support for generating a uialertview when restkit encounters a 503 response; added ability to turn 503 error on/off, as well as ability to customize the alert
2011-01-06 11:55:43 -08:00
Jeff Arena
e991ad7033
change RKRequest delegate didfinishload method signature to be a bit cleaner; added code to turn off the reachability observer when the app becomes inactive; changed online/offline state code to support an undetermined state at initial launch, so as to ensure we get all our proper notifications during first run; remove unnecessary debug logging from rkrequestqueue; removed three20 model code that was triggering a forced offline state, which currently does not have a recovery path (e.g. if the app is forced offline, we currently have no built-in mechanism to allow a force back online)
2010-12-08 09:45:26 -08:00
Jeff Arena
d91223b6fa
fixed a crash related to parsing a non-JSON error from a response string; fixed issue with callbacks being fired after a request has been cancelled; fixed leak of resourcePath in RKRequestTTModel; fixed issue with autoreleasepool being drained before background thread objects have been transferred to the callback method; fixed issues with mutating the requestqueue array during enumeration while performing bulk cancels; added additional logging that has been helpful in tracking down many of these crashes (to be removed prior to merge to master)
2010-12-02 19:28:25 -08:00
Jeff Arena
507509fd3e
bug fixes for issues related to error conditions that were preventing our request lifecycle from completing correctly
2010-12-02 14:17:58 -08:00
Jeff Arena
c9ba879937
removed duplicate delegates on RKObjectLoader; inverted control for communicating request completion from RKResponse to RKRequest; added state tracking to RKRequest for loaded and loading states; changed queue processing logic to check request states before firing new requests; removed retains of RKObjectLoader from RKRequestTTModel since our queue is handling retains for all asynchronous RKRequest flavors; added separate state tracking to RKRequestTTModel since there are subtle differences between the meaning of loaded/loading in Three20 versus our RKRequest states; removed delegate forwarding code from RKObjectLoader since it is no longer an RKRequestDelegate (which was quite ugly to begin with); removed unnecessary error contructor for RKResponse that was only being used to fire delegate callbacks when an RKRequest failed to fire in offline mode; added TODOs to deep-dive into synchronous request handling
2010-12-02 13:22:38 -08:00