Commit Graph

123 Commits

Author SHA1 Message Date
Brian Morton
cf98c5ac16 Merge pull request #587 from cfis/connectRelationshipContext
connectRelationship Using Incorrect ManagedObjectContext
2012-03-11 14:05:54 -07:00
Blake Watters
88ab404ea1 Load the Core Data momd from RestKitResources.bundle 2012-03-09 17:48:51 -05:00
Blake Watters
1c59f5fc1e Cleaned up the naming on RKManagedObjectStore to primaryManagedObjectContext and managedObjectContextForCurrentThread 2012-03-09 09:02:21 -05:00
Charlie Savage
0337689343 Make sure that ConnectRelationship is using the correct managed object context. Currently it assumes the default managedObjectContext, but that is not correct when multiple databases are open using different managedObjectContexts. 2012-03-07 23:35:16 -07:00
Blake Watters
53bbeca099 Clean up build issues on OS X 2012-02-25 12:07:06 -05:00
Blake Watters
2040283e9e Add RKManagedObjectMappingCache.h to Public/ headers and add RKObjectMappingProvider+CoreData.h to CoreData.h 2012-02-23 22:50:17 -05:00
Jeff Arena
32ab17fe0b Incorporate code review feedback 2012-02-23 22:39:27 -05:00
Jeff Arena
1cd22d5b33 First pass at replacing RKManagedObjectCache with a more flexible block approach that leverages the new resource path pattern matching approach to registering objectMappings. 2012-02-23 22:30:08 -05:00
Blake Watters
6c4461956f Recreate the retained MOC reference on store deletion 2012-02-23 20:49:59 -05:00
Blake Watters
5b655f1a23 Decoupled managed object contexts from the sharedManager instance. Various minor cleanups in CD. 2012-02-23 15:25:41 -05:00
Blake Watters
e904394b6b Miscellaneous cleanups 2012-02-17 16:34:03 -05:00
Blake Watters
4d48ef4729 Fixed breakage in OS X support 2012-02-15 17:48:59 -05:00
Blake Watters
789b0b99eb Implemented support for hydrating to-many relationships. closes #284 2012-02-15 11:09:21 -05:00
Blake Watters
4142ffdb42 Reorganization and cleanups of Unit Tests
* Reorganized tests to accommodate split into Logic & Application.
* Eliminated 'Spec' naming in favor of 'Test' as the suite is entirely based on SenTest.
* Pulled majority of testing support classes up into the library and documented them.
* Introduced RKApplicationTests app for running the RKTableController UI tests
2012-02-10 17:32:23 -05:00
Blake Watters
36dfd9528e Change managed object context merge policy from NSOverwriteMergePolicy to NSMergeByPropertyStoreTrumpMergePolicy 2012-02-10 16:30:58 -05:00
Jeff Arena
847ed50bc0 Reduce log level for a log entry in RKManagedObjectMappingOperation 2012-02-10 16:30:54 -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
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
Blake Watters
412b0f9756 Work in progress on cleanup 2012-01-20 10:21:18 -05:00
Ray Fix
8ac6f66f99 Add an assert to prevent weird errors. 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
Julien Grimault
a1e2061106 Modified asserts in RKObjectLoader processMappingResult to allow synchronous requests. 2011-12-13 20:58:15 -05:00
Ray Fix
f23b242e87 First cut at issue 451, shouldDeleteOrphanedObject.
The test is currently failing and the 6 results are
returned instead of keeping alive only the original
4 result objects.  Requires further investigation.
2011-12-11 09:13:35 -08:00
Blake Watters
4a45a15da1 Fixed nearly all broken tests for OS X target 2011-12-09 00:30:34 -05:00
Blake Watters
479864902b Fixed all build warnings on OS X Framework target 2011-12-08 23:23:20 -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
f5008ff9fe Cleaned up broken specs for iOS. 2011-12-02 09:26:35 -05:00
Blake Watters
5b718890ac Checking in work in progress on the library reorganization 2011-12-02 09:26:35 -05:00
Blake Watters
70e2accd1d Remove performSelector invocations that have resulted in App Store rejections. fixes #442 2011-11-17 15:32:48 -05:00
Blake Watters
585d4aafc8 Implemented MIMETypeForPathExtension for NSURL and NSString. refs #409
Refactored duplicated code for returning the MIME Type based on file path extension using
Core Services UTI.
2011-10-16 02:06:58 -04:00
Blake Watters
c29046075f Merge pull request #399 from Felixyz/validationErrorLogging
Log much-needed info when context fails to save
2011-10-12 20:03:59 -07:00
Felix Holmgren
a235610ab4 Log much-needed info when context fails to save
* Makes it much easier to debug Core Data validation problems
  * Adapted from code by Chris Lozach
  * See: http://stackoverflow.com/questions/1283960/iphone-core-data-unresolved-error-while-saving
2011-10-12 21:04:57 +02: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
2f91e71c3a Merge pull request #356 from jobi/master
Allow specifying the bundle when seeding from a file
2011-09-21 05:52:24 -07:00
Blake Watters
0b5233916a Fixed bug where relationship connection was working off of source keyPath instead of destination (i.e. relationship name). fixes #357 2011-09-20 19:20:19 -04:00
Johan Bilien
cee8f13c6c Add a way to specify the bundle from seeding from a file
[NSBundle mainBundle] doesn't work for logic tests, which don't have an
application bundle.
2011-09-20 16:01:14 -04:00
Blake Watters
0c96aedc85 Fix use of reserved 'class' keyword that breaks import into Objective-C++. fixes #355
Added basic spec file that imports the public headers into an Objective-C++ source file.
2011-09-20 13:04:29 -04:00
Blake Watters
70c73f2981 Fixed issue with order dependence in Core Data connections. fixes #173
Since OM 2.0 connection of relationships happened during the object mapping operation
instead of aggregately at the end of the process. In this commit, we have introduced a lightweight
queue for deferring portions of the mapping operation until a larger aggregate mapping has completed.

The changes are as follows:
* Introduced RKMappingOperationQueue for queueing portions of mapping. This is a synchronous queue modeled off
of NSOperationQueue that does NOT use threading (for Core Data friendliness).
* RKObjectMappingOperation now has a RKMappingOperationQueue queue property that defaults to nil
* RKObjectMappingOperation instances built via RKObjectMapper will has a mapping operation queue
assigned to the property.
* If a queue is present, RKManagedObjectMappingOperation will use it to defer the connection of relationships.
* At the end of an RKObjectMapper process, the mapping operation queue used by all mapping operations created
during the process will be executed. This allows all relationships to be connected after all object creation
has completed.

The queue is general purpose, though currently only used for the connection of relationships.
2011-09-20 12:02:50 -04:00
Greg Combs
52e5a7b911 AppDirectory return value was incorrect for OSX Core Data. Fixes #350. Thanks @martijnthe 2011-09-18 12:00:23 -05:00
Greg Combs
62d7042ebc Merge pull request #334 from parkerboundy/add-apache-license
Add the Apache License to headers (Issue #145) Closes #145.  Thanks @parkerboundy.
2011-09-14 21:56:15 -07:00
Blake Watters
05b94cae5d Added assertions for object store nilness.
The managedObjectContext helper method will now raise an exception if there is not a sharedManager or the current sharedManager does not have an objectStore configured.
2011-09-13 13:13:12 -04:00
Parker
c888af6f25 Added Apache License header to files in CoreData directory
Didn't add header to NSManagedObject+ActiveRecord.h,
NSManagedObject+ActiveRecord.m and RKManagedObjectCache.h .
NSManagedObject+ActiveRecord was adapted from someone else, and
RKManagedObjectCache has different code formatting. Will update those
once I get confirmation on them.
2011-09-07 11:55:17 -04:00
Blake Watters
b96940cc64 Eliminated requirement to use -all_load linker flag. Fixed breakage in OS X builds due to ivar/property name disagreement. Removed references to all_load from the install docs. fixes #239 2011-09-01 20:52:46 -04:00
emil.wojtaszek
de5b7111a1 bug fix with wrong path to data store on mac 2011-08-25 20:38:33 -04:00
Blake Watters
272b161732 Fix incorrect import causing build breakage. fixes #299 2011-08-15 08:02:14 -04:00
Blake Watters
2e430644d9 Added support for using NSEntityDescription to lookup property types for NSManagedObject attribute and relationships. This enables mapping type transformations on mappings defined against Core Data entities instead of concrete subclasses. fixes #233 2011-08-14 23:21:51 -04:00
Blake Watters
4e03ba7bef Renamed Polymorphic mapping to dynamic mapping after consulting with the community. Dropped abstract superclass in favor of a RKObjectMappingDefinition protocol. Caught missing cases with dynamic object mapping + targetObject. Updated docs and method signatures to reflect the updates. 2011-07-31 19:37:42 -04:00