Commit Graph

126 Commits

Author SHA1 Message Date
Blake Watters
7c76b493dd Update object loader to properly propagate errors back from mapper 2012-08-23 18:44:46 -04:00
Blake Watters
e7d768dd2f Update RKObjectMapper to return a single NSError on failure. Update error codes 2012-08-17 13:09:47 -04:00
Blake Watters
07aadeebdf Reimplemented the managed object store, converted managed object seeder to importer, cleaned up test breakage. 2012-07-26 17:33:35 -04:00
Blake Watters
b25a1833b3 Ported RestKit to using managed object contexts with concurrency types. Numerous cleanups and API updates. 2012-07-16 22:47:06 -04:00
Blake Watters
f0706dbdbf Work in progress
Conflicts:
	Code/CoreData/RKManagedObjectLoader.h
	Code/CoreData/RKManagedObjectLoader.m
	Code/CoreData/RKManagedObjectMapping.m
	Code/CoreData/RKManagedObjectMappingOperation.m
	Code/CoreData/RKManagedObjectStore.m
	Code/CoreData/RKManagedObjectThreadSafeInvocation.h
	Code/CoreData/RKManagedObjectThreadSafeInvocation.m
	Code/CoreData/RKSearchableManagedObject.m
	Code/ObjectMapping/RKObjectLoader.m
	Code/ObjectMapping/RKObjectMapper.h
	Code/ObjectMapping/RKObjectMappingOperation.m
	RestKit.xcodeproj/project.pbxproj
	Tests/Logic/CoreData/RKManagedObjectThreadSafeInvocationTest.m
2012-07-13 13:07:42 -04:00
Blake Watters
ec6cdd1356 Migrate performSelectorOnMainThread and performSelectorInBackground invocations to GCD 2012-07-11 16:45:08 -04:00
Blake Watters
57e4e0933a Migrated from Grand Central Dispatch queue for mapping into an NSOperationQueue to enable KVO 2012-07-11 16:43:19 -04:00
Jawwad Ahmad
82f4630d36 Whitespace syntax cleanup. Refs #614 2012-07-11 10:41:38 -04:00
Jawwad Ahmad
abb46c382c Ensure the stars for all pointers belong to the variable rather than the type. Refs #614 2012-06-04 22:47:30 -04:00
Jawwad Ahmad
eaa5484b01 Placing opening braces on a new line for methods to match Apple convention. Refs #614
Used uncrustify's "nl_fdef_brace = add" option to detect issues.
2012-06-04 00:36:19 -04:00
Jawwad Ahmad
10433089a4 Strip trailing whitespace. Refs #614 2012-06-03 22:33:31 -04:00
Blake Watters
9ca2ba2a3f Clean up inconsistencies with 'cancelled' and 'cancel' to match Cocoa (isCancelled) 2012-05-21 18:11:15 -04:00
Blake Watters
ada95e0281 Migrate RKResponse property from RKObjectLoader to RKRequest. refs #527 2012-05-18 20:05:25 -04:00
Blake Watters
016f13dad0 Convert all tabs to four spaces. refs #743 2012-05-17 18:10:59 -04:00
Blake Watters
fcb973056b Cleanup trailing whitespace. refs #743 2012-05-17 18:00:16 -04:00
Blake Watters
938304d542 Fixes to ensure failed requests are not resent. refs #628, fixes #744, closes #720
Additional changes and test coverage to handle the case of loading an invalid URL
or otherwise immediately encountering an error condition:

* Restores use of removeLoadingRequest: within the queue
* Updates fragile tests to ensure better coverage for error cases
* Sets isLoaded to YES during error callbacks to prevent duplicated dispatching
2012-05-16 23:50:43 -04:00
Blake Watters
457a6126cf Refresh copyright notices for all source files 2012-04-04 09:08:54 -04:00
Blake Watters
e79b79ebac Change behavior of delegate callbacks during 204 (No Content) response. refs #633 2012-04-03 23:39:43 -04:00
Blake Watters
57183b364f Fix for warning emitted due to elimination of findOrCreateInstanceOfEntity:. Search Word functionality restored. closes #584
* Updates to the Core Data layer such that NSManagedObjectContexts now have a reference to the managed object store
they belong to.
* NSManagedObject instances can now return the managed object store they belong to.
* Relaxed the coupling to the sharedManager present within the RKSearchableManagedObject class.
* Expanded documentation of RKSearchableManagedObject
2012-03-14 17:08:02 -04:00
Blake Watters
4d48ef4729 Fixed breakage in OS X support 2012-02-15 17:48:59 -05:00
Blake Watters
948cc85873 Added new pre-flight delegate callbacks for customization of RKRequest and RKObjectLoader instances before dispatch 2012-02-15 12:06:24 -05:00
Blake Watters
3d0f0ab39e Introduced the RKTableController component for iOS.
RKTableController provides a flexible, integrated system for driving iOS table views using
the RestKit object mapping engine. Local domain objects can be mapped into table cells within a
collection or presented for editing as part of a form. There are three flavors of table controllers
available:

* Static Tables: RKTableController can be used to render simple static tables that are composed of RKTableItems
presented in RKTableSections. Table items can quickly be built and added to a table without a backing model
or can have content object mapped into them for presentation.
* Network Tables: RKTableController can also render a table with the results of a network load. The typical use
case here is to have RestKit retrieve a JSON/XML payload from your remote system and then render the content into
a table.
* Core Data Tables: RKFetchedResultsTableController can efficiently drive a table view using objects pulled from a
Core Data managed object context. Typical use-cases here are for the presentation of large collections that are
pulled from a remote system, offering offline access, or speeding up a UI by using Core Data as a fast local cache.

RKTableController supports a number of bells and whistles including integrated searching/filtering and pull to refresh.
2012-02-10 16:30:54 -05:00
Blake Watters
4b46ada794 Copy the error mapping to the temporary mapping provider to ensure error handling is correct. 2012-01-20 10:21:56 -05:00
Blake Watters
1d27f7bbbe Refactored object manager API's to de-emphasize delegates and removal duplication of blocks and delegates. Added block callbacks to RKObjectLoader. 2012-01-20 10:21:56 -05:00
Blake Watters
4bd12ea987 Apply rootKeyPath within the mapper rather than the object loader 2012-01-20 10:21:19 -05:00
Blake Watters
7c5ad95816 Updated all example projects to reflect changes. 2012-01-20 10:21:19 -05:00
Blake Watters
7a1dfd0857 Added support for selecting object mapping using pattern matching on resourcePath. 2012-01-20 10:21:19 -05:00
Blake Watters
6abbb34ef0 Introduced mapping contexts support.
Extended RKObjectMappingProvider to store collections of object mappings for different use cases. The framework
now stores object mappings, serialization mappings, an error mapping and a pagination mapping using the context
support. Contexts can be added to the provider via method calls or extension via a category.
2012-01-20 10:21:19 -05:00
Blake Watters
412b0f9756 Work in progress on cleanup 2012-01-20 10:21:18 -05:00
Ray Fix
ab3ec5495f Leaks brought to my attention by the static analyzer. 2012-01-20 10:21:18 -05:00
Blake Watters
fb41eb73ec Work in progress on responsibility cleanup 2012-01-20 10:21:18 -05:00
Blake Watters
254553dc7c Initial implementation of RKObjectPaginator 2012-01-20 10:21:18 -05:00
Blake Watters
4d99d28a4d Merge pull request #477 from rayfix/fix-log-root-key-path
Fixed logging of root key path on object mapping. Remove TODO comment.
2011-12-16 21:23:21 -08:00
chethan
ea0cbed8dc Fixed logging of root key path on object mapping. Remove TODO comment that is done. 2011-12-16 18:20:24 -08:00
Julien Grimault
a1e2061106 Modified asserts in RKObjectLoader processMappingResult to allow synchronous requests. 2011-12-13 20:58:15 -05:00
Blake Watters
479864902b Fixed all build warnings on OS X Framework target 2011-12-08 23:23:20 -05:00
Blake Watters
8a39f93e62 Add support for handling 204 'No Content' responses. fixes #450 2011-12-02 09:27:22 -05:00
Blake Watters
563f5e909b Updated all example projects to build against the new project. Cleaned up header imports for flattened project structure 2011-12-02 09:26:36 -05:00
Blake Watters
4b1db7a6f1 Improve assertion failure message when no serialization mapping is available and a put/postObject is attempted 2011-10-11 21:40:26 -04:00
Blake Watters
4b287a5b24 Added ability to overload the params on object loaders composed by the object manager. fixes #352 2011-09-19 19:54:58 -04:00
Parker
99250475ad added Apache License headers to all files in ObjectMapping directory 2011-09-07 11:31:01 -04:00
Blake Watters
4299cab994 Added convenience accessors on RKObjectManager for the requestCache and requestQueue. Cleaned up some styling and normalized method names. 2011-09-06 11:36:50 -04:00
Blake Watters
6cc7f1e4d6 Added test coverage for queue loading count being decremented when the response is unmappable. fixes #230, fixes #286 2011-09-03 17:29:58 -04:00
Blake Watters
84032d9aa6 De-emphasized the use of the sharedQueue and improved management of queue suspension state when changing out the baseURL on RKClient. This should prevent the queue from becoming suspended beyond the life of an RKClient that suspended it. Queues are now also properties on a per-client and per-request basis, so it is easier to segregated parts of your app into different queues. The relationship between RKRequest and RKRequestQueue should be decoupled at some point. 2011-08-18 11:48:37 -04:00
Blake Watters
ca91226129 Fix for incorrect delegate invocation on cache load. fixes #267 2011-08-01 21:54:04 -04:00
Blake Watters
670234b775 Added support for polymorphic object mapping (Github #105, #244). This enables you to dynamically map objects to different destination classes or using different mapping strategies via configuration or callbacks. See Docs/Object Mapping.md for details.
Other changes include:
* Eliminated the RKObjectFactory protocol and implementations. Object mapping instances themselves are
now responsible for instantiating target objects for mapping.
* Introduced RKObjectAbstractMapping superclass for RKObjectMapping and RKObjectPolymorphicMapping.
* Updated example applications to use block object loaders (RKTwitter and RKTwitterCoreData)
* Refactored method signatures of RKObjectMapper, RKObjectMapping, and RKObjectMappingProvider to reflect the
existence of abstract mapping types. This was necessary to make polymorphic mappings integrate cleanly.
* Fixed overlap in RestKit error domains between network and object mapping. fixes #208
2011-07-30 16:00:36 -04:00
Rémy SAISSY
2bdf855fbe finalizeLoad:error: call added in handleResponseError thus avoiding non finalized requests when receiving 40x HTTP response to requests. 2011-07-26 17:45:39 +02:00
Blake Watters
3a5354c4a0 Added specs around behavior of empty mappable payloads and RKObjectLoaderDelegate invocations. Fixed issue where empty hashes ({}) would result in no delegate methods being invoked. fixes #225 2011-07-24 01:25:50 -04:00
Blake Watters
f1b0815e1a Fixes to some violations of the contracts around delegate methods and background threads 2011-07-21 22:01:47 -04:00
Blake Watters
73fb461a8b Reworked object mapping behaviors to better accommodate situations where the server side responds with a successful status code and a payload that does not contain any mappable attributes or relationships. We now consider this to be successful. If a mapping operation is performed that does not result in any mappings being applied, it will return NO without setting an error. If an instance of RKObjectMapper is invoked that does not find any mappable content in the payload, this will result in an unmappable content error. The object loader guards against this by not attempting to map any empty payloads. This should ensure that you only get the unmappable content error if you have asked RK to load and map a payload it cannot find an object mapping for. 2011-07-07 09:53:46 -04:00