Commit Graph

61 Commits

Author SHA1 Message Date
Blake Watters
1463a7d2f8 Cleanup log warnings on OS X related to NSUInteger typedef differences (unsigned int vs unsigned long) 2012-08-07 09:58:30 -04:00
Blake Watters
e4a65b53a2 Add new queue method for checking the queue for a request with a given URL 2012-07-11 17:06:39 -04:00
Blake Watters
47347312fb Do not emit didFinishLoading unless there is not a nextRequest 2012-07-11 16:46:31 -04:00
Blake Watters
ec6cdd1356 Migrate performSelectorOnMainThread and performSelectorInBackground invocations to GCD 2012-07-11 16:45:08 -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
734b0350fe Fix spacing issues identified by uncrustify's "sp_before_sparen = add" option. Refs #614 2012-06-03 23:27:41 -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
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
f46beb90d2 Guard RKRequestQueue containsRequest: with @synchronized. closes #690 2012-05-17 00:00:05 -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
1f98cf432e Fix crash during queued load of invalid URL. fixes #628 2012-05-03 21:50:37 -04:00
Blake Watters
457a6126cf Refresh copyright notices for all source files 2012-04-04 09:08:54 -04:00
Blake Watters
175a90cabe Reorder logging statement so that logging occurs before sending of request to avoid sending message to a zombie instance. fixes #600 2012-03-20 20:43:14 -04:00
Blake Watters
4d48ef4729 Fixed breakage in OS X support 2012-02-15 17:48:59 -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
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
Brian Morton
9d5e142d10 Clean up documentation and organize RKRequestQueue and RKRequestQueueDelegate header and implementation.
* Add appledoc section headers and reorganize methods/properties to fit into the sections.
* Fill in missing documentation, parameter definitions, and return values.
* Fix documentation formatting, styling, and placement.
* Remove appledoc signficant asterisk in implementation comment.
2012-02-09 03:02:17 -08:00
Jeff Arena
7bf04e49ec Fix memory leaks in newly introduced queue code. Fixes #521. Fixes #522. 2012-01-23 17:52:29 -05:00
Jeff Arena
507dfb0cfe Copy our requestQueue array prior to fast enumeration to ensure no mutations of the underlying array occur while we are looping 2012-01-20 11:52:37 -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
Parker
e8b24a3959 added apache license to everything in the Network directory
I got tired of doing individual commits for each file, so I just did the
rest of the directory.
2011-09-07 10:45:42 -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
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
Blake Watters
0640f20bd2 Added newRequestQueueWithName to the API 2011-08-18 13:00:51 -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
Victor Kryukov
e5dd917209 Fix #180 - Network Activity Indicator Gets Clobbered by Multiple Queues 2011-08-12 12:55:55 -07:00
Blake Watters
7246afc998 Fixes to enable RestKit Core Data to be easily unit tested from a Unit Testing bundle. Improved thread safety in the request queue and fixed an issue where requests dispatched from background threads would not get callback methods due to thread termination. The request queue now guarantees requests are sent from the main thread. 2011-07-21 11:33:17 -04:00
Blake Watters
5a2f937a52 Reworked notifications for consistency with Cocoa idioms. Simplified code paths through the queue. Tweaked the logging for easier info at the Debug level without having to drop down to Trace. 2011-06-29 16:18:18 -04:00
Blake Watters
853704b2fd Rework notifications to allow request queue to observe only the requests it dispatches instead of all of them. Fixes incorrectly decrementing loading count. 2011-06-29 15:36:10 -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
8fe8e5cc75 Rework queue iteration to use a while loop and maintain a count of dequeued requests to ensure finite iteration. refs #164 2011-06-28 19:20:17 -04:00
Blake Watters
1cfa273224 Added new logging to the RKRequestQueue for inspecting what is happening. Eliminated use of copy during iteration of the request queue to avoid issues with re-entrant invocations of the queue resulting in the queue becoming starved. Fixed a number of flaky tests by making the RKSpec helpers stub out network availability. closes #164 2011-06-28 18:18:49 -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
Scott Penrose
d6bd24a350 RKRequestQueue loadNextInQueue stuck in infinite loop if you start a request and then cancel immediately. On cancel only decrement loadCount if the request has start loading. This needs to be merged into master #122 2011-05-29 00:52:16 -04:00
Blake Watters
1437026e43 Fail out build process when run_command encounters non-zero exit status. Fixed OS X compile issues introduced by automatic network activity indicator. refs #57 2011-04-19 13:13:34 -04:00
Blake Watters
381ccadbe2 Added support for spinning the Network activity indicator when busy 2011-04-19 09:59:57 -04:00
Blake Watters
7837e245d9 Implemented support and tests for queue processing delegate methods. 2011-04-19 09:38:25 -04:00
Chad Podoski
f44abbee27 Generalize RKRequestQueue and add NSDecimalNumber type support to RKObjectMapper. refs #50 2011-04-18 17:21:01 -04:00
Blake Watters
9593612aab Closes gh-47. Initial implementation of OS X build integrating changes submitted by Felix Holmgren (https://github.com/Felixyz/RestKit).
* Factored out display of alerts into RKAlert interface that hides the differences between UIKit and OS X Cocoa.
* Added macosx to supported platforms to enable build on OS X.
* Configured project to use conditional architectures to enable building on OS X and iOS from the same targets.
* Implemented a bare-bones OS X example app.
* Create `rake build` task for building RestKit against iOS and OS X SDK for quick testing.
2011-04-12 21:02:25 -04:00
Blake Watters
a648d26460 [#11477593] Implemented background request policies and Specs. This provides functionality for continuing a request in the background using an iOS background task.
Introduces four modes for handling background requests:
* RKRequestBackgroundPolicyNone - The default behavior replicating pre-background behavior. No special action is taken with regards to backgrounding.
* RKRequestBackgroundPolicyCancel - On transition to the background, requests with this policy set will be cancelled automatically and the delegate informed.
* RKRequestBackgroundPolicyContinue - Requests with this policy will be continued in the background after the app has been transitioned.
* RKRequestBackgroundPolicyRequeue - Requests with this policy will be cancelled and then immediately placed onto the queue for processing the next time the app is returned to the foreground.
2011-04-05 13:06:06 -04:00
Blake Watters
7589060e6d Merge branch '0.9' of github.com:twotoasters/RestKit into 0.9 2011-04-05 10:06:43 -04:00
Jeremy Ellison
322599e14a Updates from development of Go Try It On v2.0:
* Updates YAJL Parser not to raise an exception and crash when it encounters invalid JSON. The other parsers need to be aligned with this behavior and the delegate methods updated. See Pivotal Story: https://www.pivotaltracker.com/story/show/11925617
* Added requestDidCancel: delegate invocation for tracking cancellation of requests.
* Ensure that the request queue timer is cleared during indeterminate deferral of request loads.
2011-04-05 10:02:34 -04:00
Blake Watters
c23eac631d remove unconnected timeout constant 2011-04-04 19:43:21 -04:00
Blake Watters
c90ec2770d Finished cleanup of HTTP AUTH and XML Support. Ready to tag 0.9.1 2011-03-28 23:29:06 -04:00
Jeff Arena
797904d5a1 use copy of requests array when use fast enumeration in loadNextInQueue; add autorelease pools to methods that copy the request array to ensure we immediately clean up our copies upon completion 2011-03-23 08:33:33 -07:00