Commit Graph

87 Commits

Author SHA1 Message Date
Blake Watters
fe3b710e9a Add RK prefix to module header files to disambiguate on import from CocoaPods 2012-08-28 21:01:07 -04:00
Blake Watters
ce6b0829e4 Convert RestKit to ARC 2012-08-28 17:34:58 -04:00
Blake Watters
274478448d FIXUP: Merge with "Drop RestKit networking layer in favor of AFNetworking" 2012-08-28 16:32:15 -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
6b315fbd54 Updates to entity cache and other components to operate in parent/child context world. 2012-07-20 14:48:09 -04:00
Blake Watters
e952f451fb Eliminated the use of the ActiveRecord pattern across the library. 2012-07-20 14:48:09 -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
fe9bfe59da [REBASE] Rename Router -> RouteSet. Add new Router class for generating URL's from the routes. 2012-07-11 17:00:32 -04:00
Blake Watters
6c3b75039b [REBASE ME] Refactored Router for simplicity, nearly done with design. Initial support for relationship loading from object manager. 2012-07-11 16:52:46 -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
Blake Watters
ffa2fc685e Introduced named route support. refs #779
* Provides for the registration of route either by class and method or via symbolic name
* Changed routes representation from simple dictionary to RKRoute model
* Eliminated RKRouter as a protocol
* Migrated RKObjectRouter to Network layer and renamed to RKRouter
* Added router as property of RKClient, RKObjectManager now proxies access
2012-07-11 16:06:55 -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
Blake Watters
31191f59b6 Migrate initialization of default error mapping from RKObjectManager to RKObjectMappingProvider 2012-05-21 12:09:27 -04:00
Blake Watters
489bb0423a Fix static analyzer issues 2012-05-18 20:01:56 -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
Boris Dušek
e932c31cde Update RKObjectManager to observe changes to the reachability observer of
the underlying RKClient object. refs #717
2012-05-16 15:10:18 -04:00
Blake Watters
457a6126cf Refresh copyright notices for all source files 2012-04-04 09:08:54 -04:00
Blake Watters
b0ab880868 Fixed bug raising exception when loaderForObject: is invoked with a method of RKRequestMethodInvalid. fixes #601 2012-03-19 16:03:25 -04:00
Blake Watters
5ffeee38d4 Ensure serializationMIMEType is configured when initializing object loaders via loaderWithURL: or loaderWithResourcePath: fixes #567 2012-03-12 20:34:31 -04:00
Blake Watters
4d48ef4729 Fixed breakage in OS X support 2012-02-15 17:48:59 -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
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
7c5ad95816 Updated all example projects to reflect changes. 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
89b02e7550 Refactored paginator to use RKURL rather than relying on its own baseURL and resource path. Expanded paginator documentation. 2012-01-20 10:21:18 -05:00
Blake Watters
412b0f9756 Work in progress on cleanup 2012-01-20 10:21:18 -05:00
Ray Fix
3d03959d06 Polish RKObjectPaginator.
Initialization
I need the object paginator's object loaders to 
know about the various header settings of 
the RKClient when it constructs them.  However,
the paginator should not depend on an RKObjectManager.
The proposed solution is to pass a block that lets
an outsider custom configure the object loaders
that get created.  The object manager shows how
it is done.

Error Handling
We don't want to have a separate set of error handling
if using a paginator versus using an RKObjectLoader.
When an error is encountered, the paginator should 
allow access to the underlying RKObjectRequest that
produced the error.

Cleanup
The contained object loader needs to nil out the delegate
before going away.

NSLogs changed to RKLog

Pagination computation
The page count can be computed when the pagination 
parameters are mapped.  Note you must use the ceil
operation to compute this value.  If there are 3.1 pages
that means there are 4 pages.
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
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
d75fd7d0b0 Refactored RKReachabilityObserver to work around issues with iOS 5 + host reachability and expand its capabilities. closes #408
* Added support for monitoring by IP address or hostname as well as local Wifi and Internet access generally
* Eliminated usage of synchronous calls to obtain reachability flags during status checks
* Reworked SystemConfiguration reachability callback to cache flags
* RKClient now monitors Internet access instead of hostname based reachability by default. baseURLReachabilityObserver eliminated in favor of reachabilityObserver. It is now a retain property that can be customized
* Queue suspension is now tied to the reachability observer rather than baseURL mutation
2011-10-19 08:51:37 -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
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
Blake Watters
f547439254 Merge pull request #247 from rehos/patch-1
Use the actual class instead of hardcoded RKObjectManager class
2011-07-28 14:27:20 -07:00
Blake Watters
46ab501cab Introduced loadObjectsAtResourcePath:delegate:block: helper 2011-07-28 16:41:41 -04:00
Blake Watters
e6e528fcf1 Improved the flexibility of the block loaders significantly by allowing them to override the object mapping and routing selection. Made sendObject:method:delegate:block private and introduced public sendObject:delegate:block method instead. Wrote some basic specs for overriding the router. 2011-07-28 13:56:16 -04:00
rehos
b9d29b8759 Use the actual class instead of hardcoded RKObjectManager class in objectManagerWithBaseURL: 2011-07-26 16:01:43 +03:00
Blake Watters
ee5457105e Fix memory leak of mapping provider 2011-07-25 17:58:03 -04:00
Blake Watters
a0cb33d391 Updates comments on inferMappingsFromObjectTypes and add documentation to the Object Mapping document. Defaulted it to off
as it can complicate things for KVC mappable data.
2011-07-24 12:28:42 -04:00
Blake Watters
570b13ca07 Updated Object Mapping documentation, added support for inferring object mappings based off of the type of the object used in postObject:, putObject:, etc. Made KVC validation optional. 2011-07-23 23:47:03 -04:00
Blake Watters
80366afa84 Added Object Mapping block helpers to RKObjectManager and RKObjectMapping. These enable you to perform ad-hoc object mapping very easily. Extended RKObjectRouter to match on superclasses if no specific route is found. This is helpful when using mocked objects with frameworks like Kiwi. fixes #238 2011-07-23 23:04:16 -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
2a8ece97c1 Improvements to reachability, the request queue, logging throughout the network layer, decoupling of components via notifications, reliability improvements for unit tests in the cache layer. Improved thread-local cleanup routines inside the managed object store. Changing base URL's is now more reliable. fixes #171, #158, #113, #104, #102 2011-06-29 13:28:14 -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
Blake Watters
5f7b8559cd Only build a serialization if we are a POST or a PUT 2011-06-15 10:29:11 -04:00