Commit Graph

272 Commits

Author SHA1 Message Date
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
d4e3c0d559 Remove Appledoc significant asterisk in non-documenting comment 2012-02-02 09:21:00 -05:00
Brian Morton
f92fbb9f8e Fix issue that caused appledoc to fall over while building documentation.
There's currently a known issue for appledoc (https://github.com/tomaz/appledoc/issues/147) that causes it to fall over when it encounters a method declaration in an implementation that is missing a type (even if its in the header file).  While this is valid Objective-C, lets update this to allow appledoc to go on its merry little way.

* Fix 1 declaration relating to atKeyPath: in RKObjectMapper.m
* Fix 2 declarations relating to atKeyPath: in RKObjectMapper_Private.h
* Fix 1 declaration relating to atKeyPath: in RKObjectMappingOperation.m

All declarations were changed to declare keyPath as an (NSString *).
2012-01-28 13:40:38 -08:00
Christopher Swasey
b3c5ba62d2 Replace the XMLParser with one based on Insert-Witty-Name/XMLReader 2012-01-24 12:01:47 -05:00
Blake Watters
9e0149fc0f Deprecate RKMakePathWithObjectAddingEscapes and cleanup usage within the Router 2012-01-24 09:51:05 -05:00
Jeff Arena
5b9445cef0 Slight refactor of RKObjectPropertyInspector to expose a previously private, instance method as a public, class method, for use in processing transformable attributes in the associated CoreData category. Fixes #498. 2012-01-23 18:10:06 -05:00
Jeff Arena
aac9abc0ad Audit uses of setValue:forKey: in mapping operations and replace with setValue:forKeyPath: where appropriate. Fixes #421. 2012-01-21 13:11:35 -05:00
Christopher Swasey
886ec75283 Import http://boredzo.org/iso8601parser/ and add it as a defaultDateFormatter for parsing ISO8601 strings. Fixes #438 2012-01-20 15:13:45 -05:00
Jeff Arena
700456c8eb Add support for serializing NSOrderedSet. Fixes #514. 2012-01-20 14:27:19 -05:00
Christopher Swasey
b1f4e1ffe5 RKObjectMappingOperation#parseDateFromString now transforms string representations of integers into dates as if they were unix timestamps 2012-01-20 12:59:16 -05:00
Jeff Arena
db0646ed19 Change NSNumber -> NSDate transformation to use doubleValue instead of intValue to ensure we do not lose precision on date conversion. Fixes #455. 2012-01-20 11:57:47 -05:00
Jeff Arena
dbb12b37a8 Fix a few issues with broken tests 2012-01-20 11:29:17 -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
d69adccdd6 Added block callback handlers and tests for RKObjectPaginator. 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
560032fd6d Additional documentation and miscellaneous test coverage. 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
3a8221aa08 Added support for configuring and retrieving object mapping via resource path patterns. 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
ab3ec5495f Leaks brought to my attention by the static analyzer. 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
Brian Morton
0f3f3d5702 Add support for mapping an array to an NSOrderedSet. 2012-01-13 00:04:40 -08: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
6f68ffb342 Applied patch from Scott Penrose to handle issues with NSNull values mapped to Core Data properties. closes #436
Added RKLogWarning for aiding in further debugging. So far unable to trap this in a unit test, but have had
several complaints about the issue on the mailing list.
2011-12-02 09:27:23 -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
5b718890ac Checking in work in progress on the library reorganization 2011-12-02 09:26:35 -05:00
Blake Watters
ceb7eb478a Merge pull request #425 from jsullivanlive/patch-1
Adding missing exception name
2011-12-01 16:45:08 -08:00
Aaron Crespo
6b8ab373ac Update Code/ObjectMapping/RKObjectMapping.m 2011-11-03 16:26:50 -03:00
James Sullivan
8282bdb644 Fixing missing exception name. Without it, no exception is printed to the console in debug mode and no stack trace persists, which makes it very hard to debug. 2011-10-27 21:57:19 -03:00
Blake Watters
cb694c3e77 Lowered logging level for NSNull collection from Warning to Debug. closes #422 2011-10-27 10:15:29 -03: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
Blake Watters
23422c7f37 Expanded docs in RKObjectMappingProvider. Normalized some method signatures 2011-10-13 23:51:16 -04:00
Blake Watters
f527918b2a Implemented support for removing mappings from RKObjectMappingProvider by keyPath. Improved documentation on the mapping provider class. 2011-10-13 08:57:18 -04: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
e1936103fd Check the type of destinationValue as well as sourceValue when determining the comparison selector to use. refs #343, refs #320
Hopefully this will fix the Core Data default attribute problem that I have been unable to recreate in unit tests.
2011-10-09 21:24:09 -04:00
Blake Watters
69e560d59c Fix for leaking object mapping queue references. fixes #390 2011-10-05 23:26:05 -04:00
Blake Watters
586034bae4 Add support for the use of nesting key attributes as the primaryKey in managed mappings.
This bug was causing duplication of objects in the store due to failed lookup of
existing objects. Added fix and test coverage for the use-case.
2011-10-05 10:50:52 -04:00
Blake Watters
a4d84aadf3 Use lastObject instead of objectAtIndex: to avoid exception during sanity check 2011-10-04 10:47:33 -04:00
Blake Watters
d94fcf665d Added sanity check that relationship mapping is not targeting a collection of collections. fixes #386
This can happen when using keyPaths to traverse an object graph and is hard to anticipate when
defining mappings. RestKit will now perform a sanity check before recursively performing
relationship object mapping operation and will log a warning if the relationship targets
a collection containing another collection. At the debug logging level, RestKit will log

The fix for such scenarios is to use KVC collection operators (such as @unionOfObjects,
@unionOfArrays, etc.) to flatten the collection out into a collection of dictionaries.
2011-10-01 11:52:51 -04:00