Commit Graph

55 Commits

Author SHA1 Message Date
Parker
ccb3cb4332 Added license to files in the Three20 directory 2011-09-07 12:03:57 -04:00
Blake Watters
d9d0f7a650 Eliminated the global sharedQueue in favor of allowing each RKClient to own its a private queue. This eliminates problems where multiple clients are tracking reachability notifications and mutating the suspension state on a single queue. If you want to use a single queue across multiple RKClient instances, you can assign a single queue to both and worry about suspension and reachability yourself. fixes #278 2011-09-03 15:52:45 -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
Jeremy Ellison
ffe46ffeaa If the RKObjectLoaderTTModel wants to load without Disk cache (TTURLRequestCachePolicyDisk), tell the object loader not to use the RK cache. 2011-06-30 12:54:03 -04:00
Blake Watters
13da6aa77e Fix memory leak in the Three20 data source 2011-06-20 15:49:29 -04:00
Jeremy Ellison
9388673d67 Allow RKRequests (and object loaders) to be 'reset' so that you can send them again.
Reset RKObjectLoaders before sending them in RKObjectLoaderTTModel. This fixes reloading of the model (i.e. pull to refresh).
2011-06-16 13:45: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
bc355d69fd Added NSAssert statements to try and prevent accidental configuration of a Three20 model with an object loader that has already been sent. 2011-06-11 20:24:27 -04:00
Blake Watters
69ded29245 Improved Three20 integration by leveraging object mapping to instantiate TTTableItems 2011-06-11 19:33:42 -04:00
Blake Watters
8be34582a5 Ported DiscussionBoard to new Three20 class structure 2011-06-11 19:31:21 -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
Blake Watters
dede096d61 Fixed missing semi-colon from warnings cleanup. Added Three20 and RKCatalog to the rake validate task. 2011-04-22 14:45:48 -04:00
Blake Watters
c35d0bab1d Implemented substantial catalog example application covering advanced usage of RestKit:
* Cleaned up remaining warnings about if (self = [super init])
* RKParamsExample - Highlights multi-part uploads
* RKRequestQueueExample - Working with the request queue
* RKBackgroundRequestExample - Examples of using the background policies for backgrounding requests
* RKReachabilityExample - Shows how to work with the reachability observer
* RKRelationshipMappingExample - Shows how to map related objects from JSON into an object graph
* RKCoreDataExample - Shows the basics of using RestKit's Core Data examples

Also rearranged dispatch of RKRequest delegate method for didStartLoad: to ensure requeue callbacks get invoked in a timely manner. refs #62
2011-04-22 11:28:56 -04:00
Jeff Arena
047186401b moved logic for initiating a call to the server based on an empty local cache from initial load code path to the reload code path, thus simplifying this use case when in offline mode 2011-03-16 14:28:30 -07:00
Jeff Arena
7896232cc2 completed rollback of changes to default refresh rate code by setting the default loaded time for an app to the first-run date of the app 2011-03-12 09:40:35 -08:00
Blake Watters
a056aff2b8 dont check the online state when creating an object loader in the TTModel, prevents load issues at app launch 2011-03-11 12:58:40 -05:00
Blake Watters
cbc4c7169c Remove unnecessary retain from object loader initialization 2011-03-08 12:00:36 -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
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
90c85e632f Default loaded time should be equal to -defaultRefreshRate ago, thus ensuring the cache is outdated on the first load 2011-01-12 14:35:50 -05:00
Jeremy Ellison
378aaac12b Topic and post creating, editing, and deleting 2011-01-11 12:32:18 -05:00
Jeff Arena
2b4a95df3c added caching for filteredObject on the filterable model class to prevent expensive filtering operations every time we grab the objects from the model; added code to prevent an automatic load in offline mode when we have no cached objects, as our use of an error condition to signal a request failed in offline mode triggers a three20 error overlay that we likely do not want in what should be considered a normal operating mode (e.g. app offline with no objects for a view is not an error) 2010-12-09 11:47:20 -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
f875ec167d fixed timing issue with setting loadedTime 2010-12-04 22:23:30 -08:00
Jeff Arena
af0c7ab36e fix bug with setting loaded time when loading from cache 2010-12-04 09:06:39 -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
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
Jeff Arena
6249ece2bc Merge branch 'reachability-queue-three20' of git://github.com/twotoasters/RestKit into reachability-queue-three20
Conflicts:
	Code/Network/RKRequest.m
	RestKit.xcodeproj/project.pbxproj
2010-12-01 21:06:54 -08:00
Jeff Arena
39f3d568e2 added reachability support at the manager and client level; added code to short circuit requests if offline; fixed issue with source parameter on loader related to passing managed objects across thread boundaries; added resource path property to the loader 2010-11-30 19:38:27 -08:00
Jeff Arena
c19d305b45 fix for mapper bug that was assuming a 1:1 mapping between object classes and elements; removed method from dictionary category that made the 1:1 mapping assumption that caused the mapper bug; collapsed the RKRequestModel and RKRequestTTModel classes into RKRequestTTModel; made changes to the Three20 integration to perform all cache loading and network loading in response to Three20 load calls; used isOutdated TTModel method to enforce refreshRate on RKRequestTTModel 2010-11-30 15:08:05 -08:00
Jeff Arena
2a4f9435b9 new init methods on three20 models to allow for parameter setting 2010-11-12 15:17:42 -08:00
Jeff Arena
23adeae524 added support for additional objectloader delegate method to three20 component 2010-10-28 15:00:31 -07:00
Jeff Arena
cf7acd0ffa changes to ensure we do not attempt to trigger a load when we are in offline mode 2010-10-27 17:02:20 -07:00
Jeff Arena
2988ac9651 quited depracation warnings re. the old globalManager property on RKObjectManager 2010-10-22 09:43:25 -04:00
Blake Watters
4b9170ec3d Use relative include paths instead of system 2010-10-20 11:46:31 -04:00
Blake Watters
92b39313f0 Fixed bug with load happening too soon 2010-10-19 14:21:39 -04:00
Jeff Arena
c3e28d0ecb Merge branch 'master' into restkit-cache
Conflicts:
	Code/ObjectMapping/RKObjectManager.m
	Code/Three20/RKRequestFilterableTTModel.h
	Code/Three20/RKRequestModel.m
2010-10-18 16:51:58 -04:00
Jeff Arena
1a6fdeafd4 introduce RKManagedObjectCache protocol to CoreData component; cleanup remaining NSFetchRequest ivars that are now unused; add RKURL class for making resourcepath and baseurl params available to higher level components; cleanup Three20 library to incorporate latest updates from GateGuru codebase 2010-10-18 16:36:24 -04:00
Blake Watters
d9748843ca Normalized method names for loaderWith to objectLoaderWith for alignment with the delegate method signatures. Exposed objectLoader primitive used for constructing getObject/postObject/putObject/deleteObject and documented. 2010-10-18 15:56:36 -04:00
Jeremy Ellison
81e57606c4 Fix the loaders for specific objects. Requests were not actually getting sent. 2010-10-18 10:54:48 -04:00
Jeff Arena
592b2a9e32 initial pass at changing fetchRequest APIs to work with a collection of fetch requests; also performed some API cleanup on RKManagedModel 2010-10-14 19:14:55 -07:00
timkerchmar
52cf8efb8a set object loader to nil to get loading status working properly again 2010-10-12 15:04:31 -04:00
timkerchmar
fa5fefdcc5 remove unnecessary logging from recent changes. 2010-10-12 14:35:37 -04:00
timkerchmar
320e96e48e Update headers for three20 support.
Add keyPath support to the object loader.
2010-10-12 14:32:06 -04:00
Blake Watters
bd93d43f94 Finished split into more logical components. Library now copies Headers to Build/RestKit and you can selectively link against the components your app needs. libRestKit.a contains everything from the core library. 2010-10-01 13:02:24 -04:00
Blake Watters
80b3221976 Introduced pluggable parser support and added YAJL parser. Still some cleanup work to be done... 2010-09-28 14:17:26 -04:00
Blake Watters
dd959ca01e Dropped all the Resource class names to standardize around Object since that's what we are mapping 2010-09-03 20:46:34 -04:00
Blake Watters
6e9a10be20 Cleaned up API changes for Three20 support 2010-07-20 15:53:06 -04:00