mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-26 13:55:40 +08:00
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
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
}
|
||||
|
||||
- (id)initWithObject:(NSObject*)object {
|
||||
if (self = [self init]) {
|
||||
self = [self init];
|
||||
if (self) {
|
||||
_object = [object retain];
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ NSString* const kRKStringBoundary = @"0xKhTmLbOuNdArY";
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_attachments = [NSMutableArray new];
|
||||
_footer = [[[NSString stringWithFormat:@"--%@--\r\n", kRKStringBoundary] dataUsingEncoding:NSUTF8StringEncoding] retain];
|
||||
_footerLength = [_footer length];
|
||||
@@ -41,7 +42,8 @@ NSString* const kRKStringBoundary = @"0xKhTmLbOuNdArY";
|
||||
}
|
||||
|
||||
- (RKParams*)initWithDictionary:(NSDictionary*)dictionary {
|
||||
if ((self = [self init])) {
|
||||
self = [self init];
|
||||
if (self) {
|
||||
for (NSString* key in dictionary) {
|
||||
id value = [dictionary objectForKey:key];
|
||||
[self setValue:value forParam:key];
|
||||
|
||||
@@ -181,13 +181,18 @@
|
||||
[self prepareURLRequest];
|
||||
NSString* body = [[NSString alloc] initWithData:[_URLRequest HTTPBody] encoding:NSUTF8StringEncoding];
|
||||
NSLog(@"Sending %@ request to URL %@. HTTP Body: %@", [self HTTPMethod], [[self URL] absoluteString], body);
|
||||
[body release];
|
||||
[body release];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RKRequestSentNotification object:self userInfo:nil];
|
||||
_isLoading = YES;
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(requestDidStartLoad:)]) {
|
||||
[self.delegate requestDidStartLoad:self];
|
||||
}
|
||||
|
||||
_isLoading = YES;
|
||||
RKResponse* response = [[[RKResponse alloc] initWithRequest:self] autorelease];
|
||||
_connection = [[NSURLConnection connectionWithRequest:_URLRequest delegate:response] retain];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RKRequestSentNotification object:self userInfo:nil];
|
||||
}
|
||||
|
||||
- (BOOL)shouldDispatchRequest {
|
||||
@@ -256,6 +261,10 @@
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RKRequestSentNotification object:self userInfo:nil];
|
||||
|
||||
_isLoading = YES;
|
||||
if ([self.delegate respondsToSelector:@selector(requestDidStartLoad:)]) {
|
||||
[self.delegate requestDidStartLoad:self];
|
||||
}
|
||||
|
||||
payload = [NSURLConnection sendSynchronousRequest:_URLRequest returningResponse:&URLResponse error:&error];
|
||||
response = [[[RKResponse alloc] initWithSynchronousRequest:self URLResponse:URLResponse body:payload error:error] autorelease];
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
NSHTTPURLResponse* _httpURLResponse;
|
||||
NSMutableData* _body;
|
||||
NSError* _failureError;
|
||||
BOOL _loading;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
if (self) {
|
||||
_body = [[NSMutableData alloc] init];
|
||||
_failureError = nil;
|
||||
_loading = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -46,7 +45,6 @@
|
||||
_httpURLResponse = [URLResponse retain];
|
||||
_failureError = [error retain];
|
||||
_body = [body retain];
|
||||
_loading = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -73,21 +71,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dispatchRequestDidStartLoadIfNecessary {
|
||||
if (NO == _loading) {
|
||||
_loading = YES;
|
||||
if ([[_request delegate] respondsToSelector:@selector(requestDidStartLoad:)]) {
|
||||
[[_request delegate] requestDidStartLoad:_request];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
|
||||
[_body appendData:data];
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)response {
|
||||
[self dispatchRequestDidStartLoadIfNecessary];
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)response {
|
||||
_httpURLResponse = [response retain];
|
||||
}
|
||||
|
||||
@@ -107,7 +95,6 @@
|
||||
// in connection:didReceiveResponse: to ensure that the RKRequestDelegate
|
||||
// callbacks get called in the correct order.
|
||||
- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite {
|
||||
[self dispatchRequestDidStartLoadIfNecessary];
|
||||
|
||||
if ([[_request delegate] respondsToSelector:@selector(request:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:)]) {
|
||||
[[_request delegate] request:_request didSendBodyData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
}
|
||||
|
||||
- (id)initWithBaseURLString:(NSString*)baseURLString resourcePath:(NSString*)resourcePath {
|
||||
if (self = [self initWithString:[NSString stringWithFormat:@"%@%@", baseURLString, resourcePath]]) {
|
||||
self = [self initWithString:[NSString stringWithFormat:@"%@%@", baseURLString, resourcePath]];
|
||||
if (self) {
|
||||
_baseURLString = [baseURLString copy];
|
||||
_resourcePath = [resourcePath copy];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
@implementation RKRailsRouter
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_classToModelMappings = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_mode = RKSearchModeOr;
|
||||
_tokenizeQuery = YES;
|
||||
_stripWhitespace = YES;
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
@synthesize sortSelector = _sortSelector;
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.predicate = nil;
|
||||
self.sortDescriptors = nil;
|
||||
self.searchEngine = nil;
|
||||
|
||||
@@ -54,35 +54,40 @@ static NSString* const kDefaultLoadedTimeKey = @"RKRequestTTModelDefaultLoadedTi
|
||||
}
|
||||
|
||||
- (id)initWithResourcePath:(NSString*)resourcePath {
|
||||
if (self = [self init]) {
|
||||
self = [self init];
|
||||
if (self) {
|
||||
_resourcePath = [resourcePath retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithResourcePath:(NSString*)resourcePath params:(NSDictionary*)params {
|
||||
if (self = [self initWithResourcePath:resourcePath]) {
|
||||
self = [self initWithResourcePath:resourcePath]
|
||||
if (self) {
|
||||
self.params = [params retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithResourcePath:(NSString*)resourcePath params:(NSDictionary*)params objectClass:(Class)klass {
|
||||
if (self = [self initWithResourcePath:resourcePath params:params]) {
|
||||
self = [self initWithResourcePath:resourcePath params:params];
|
||||
if (self) {
|
||||
_objectClass = [klass retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithResourcePath:(NSString*)resourcePath params:(NSDictionary*)params objectClass:(Class)klass keyPath:(NSString*)keyPath {
|
||||
if (self = [self initWithResourcePath:resourcePath params:params objectClass:klass]) {
|
||||
self = [self initWithResourcePath:resourcePath params:params objectClass:klass];
|
||||
if (self) {
|
||||
_keyPath = [keyPath retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithResourcePath:(NSString*)resourcePath params:(NSDictionary*)params method:(RKRequestMethod)method {
|
||||
if (self = [self initWithResourcePath:resourcePath params:params]) {
|
||||
self = [self initWithResourcePath:resourcePath params:params];
|
||||
if (self) {
|
||||
_method = method;
|
||||
}
|
||||
return self;
|
||||
@@ -92,7 +97,8 @@ static NSString* const kDefaultLoadedTimeKey = @"RKRequestTTModelDefaultLoadedTi
|
||||
// NSObject
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.method = RKRequestMethodGET;
|
||||
self.refreshRate = [RKRequestTTModel defaultRefreshRate];
|
||||
self.params = nil;
|
||||
|
||||
14
Examples/RKCatalog/App/RKCatalog.h
Normal file
14
Examples/RKCatalog/App/RKCatalog.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// RKCatalog.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <RestKit/RestKit.h>
|
||||
#import <RestKit/CoreData/CoreData.h>
|
||||
|
||||
// Import the base URL defined in the app delegate
|
||||
extern NSString* gRKCatalogBaseURL;
|
||||
78
Examples/RKCatalog/App/RootViewController.m
Normal file
78
Examples/RKCatalog/App/RootViewController.m
Normal file
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// RootViewController.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import "RootViewController.h"
|
||||
|
||||
@implementation RootViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
_exampleTableItems = [[NSArray alloc] initWithObjects:
|
||||
@"RKParamsExample",
|
||||
@"RKRequestQueueExample",
|
||||
@"RKReachabilityExample",
|
||||
@"RKBackgroundRequestExample",
|
||||
@"RKKeyValueMappingExample",
|
||||
@"RKRelationshipMappingExample",
|
||||
@"RKCoreDataExample",
|
||||
nil];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_exampleTableItems release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return [_exampleTableItems count];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
static NSString *cellIdentifier = @"RKCatalogCellIdentifier";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
|
||||
if (cell == nil) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
|
||||
cell.textLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
}
|
||||
|
||||
NSString* exampleName = [_exampleTableItems objectAtIndex:indexPath.row];
|
||||
cell.textLabel.text = exampleName;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
// Clear the singleton instances to isolate the examples
|
||||
[RKClient setSharedClient:nil];
|
||||
[RKObjectManager setSharedManager:nil];
|
||||
[RKRequestQueue setSharedQueue:nil];
|
||||
|
||||
NSString* exampleName = [_exampleTableItems objectAtIndex:indexPath.row];
|
||||
Class exampleClass = NSClassFromString(exampleName);
|
||||
UIViewController* exampleController = [[exampleClass alloc] initWithNibName:exampleName bundle:nil];
|
||||
if (exampleController) {
|
||||
[self.navigationController pushViewController:exampleController animated:YES];
|
||||
if (exampleController.title == nil) {
|
||||
exampleController.title = exampleName;
|
||||
}
|
||||
[exampleController release];
|
||||
}
|
||||
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// RKBackgroundRequestExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface RKBackgroundRequestExample : UIViewController <RKRequestDelegate> {
|
||||
UIButton* _sendButton;
|
||||
UISegmentedControl* _segmentedControl;
|
||||
UILabel* _statusLabel;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIButton* sendButton;
|
||||
@property (nonatomic, retain) IBOutlet UISegmentedControl* segmentedControl;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* statusLabel;
|
||||
|
||||
- (IBAction)sendRequest;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// RKBackgroundRequestExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import "RKBackgroundRequestExample.h"
|
||||
|
||||
@implementation RKBackgroundRequestExample
|
||||
|
||||
@synthesize sendButton = _sendButton;
|
||||
@synthesize segmentedControl = _segmentedControl;
|
||||
@synthesize statusLabel = _statusLabel;
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
RKClient* client = [RKClient clientWithBaseURL:gRKCatalogBaseURL];
|
||||
[RKClient setSharedClient:client];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[RKRequestQueue sharedQueue] cancelRequestsWithDelegate:self];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (IBAction)sendRequest {
|
||||
RKRequest* request = [[RKClient sharedClient] requestWithResourcePath:@"/RKBackgroundRequestExample" delegate:self];
|
||||
request.backgroundPolicy = _segmentedControl.selectedSegmentIndex;
|
||||
[request send];
|
||||
_sendButton.enabled = NO;
|
||||
}
|
||||
|
||||
- (void)requestDidStartLoad:(RKRequest *)request {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Sent request with background policy %d at %@", request.backgroundPolicy, [NSDate date]];
|
||||
}
|
||||
|
||||
- (void)requestDidTimeout:(RKRequest *)request {
|
||||
_statusLabel.text = @"Request timed out during background processing";
|
||||
_sendButton.enabled = YES;
|
||||
}
|
||||
|
||||
- (void)requestDidCancelLoad:(RKRequest *)request {
|
||||
_statusLabel.text = @"Request canceled";
|
||||
_sendButton.enabled = YES;
|
||||
}
|
||||
|
||||
- (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Request completed with response: '%@'", [response bodyAsString]];
|
||||
_sendButton.enabled = YES;
|
||||
}
|
||||
|
||||
- (void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Request failed with error: %@", [error localizedDescription]];
|
||||
_sendButton.enabled = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,400 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUISegmentedControl</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBProxyObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUILabel" id="753918313">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{12, 15}, {288, 166}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="326447881"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Select the background policy to test. The server will take 5 seconds to respond. Use the home button to background the app and observe the results.</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">10</int>
|
||||
<int key="IBUILineBreakMode">0</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="1066329961">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 286}, {280, 110}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDEAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">2</int>
|
||||
</object>
|
||||
<object class="IBUIButton" id="557582877">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{95, 234}, {112, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1066329961"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Send Request</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISegmentedControl" id="326447881">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{12, 189}, {288, 30}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="557582877"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBSegmentControlStyle">2</int>
|
||||
<int key="IBNumberOfSegments">4</int>
|
||||
<int key="IBSelectedSegmentIndex">0</int>
|
||||
<object class="NSArray" key="IBSegmentTitles">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>None</string>
|
||||
<string>Cancel</string>
|
||||
<string>Continue</string>
|
||||
<string>Requeue</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBSegmentWidths">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<real value="0.0"/>
|
||||
<real value="0.0"/>
|
||||
<real value="0.0"/>
|
||||
<real value="0.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBSegmentEnabledStates">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBSegmentContentOffsets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{0, 0}</string>
|
||||
<string>{0, 0}</string>
|
||||
<string>{0, 0}</string>
|
||||
<string>{0, 0}</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBSegmentImages">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSNull" id="4"/>
|
||||
<reference ref="4"/>
|
||||
<reference ref="4"/>
|
||||
<reference ref="4"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="753918313"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">statusLabel</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="1066329961"/>
|
||||
</object>
|
||||
<int key="connectionID">9</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">sendRequest</string>
|
||||
<reference key="source" ref="557582877"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">segmentedControl</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="326447881"/>
|
||||
</object>
|
||||
<int key="connectionID">16</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">sendButton</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="557582877"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="753918313"/>
|
||||
<reference ref="326447881"/>
|
||||
<reference ref="1066329961"/>
|
||||
<reference ref="557582877"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="753918313"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="557582877"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">7</int>
|
||||
<reference key="object" ref="1066329961"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="326447881"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
<string>15.IUISegmentedControlInspectorSelectedSegmentMetadataKey</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>7.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKBackgroundRequestExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{556, 412}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<integer value="3"/>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">17</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKBackgroundRequestExample</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">sendRequest</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">sendRequest</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">sendRequest</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>segmentedControl</string>
|
||||
<string>sendButton</string>
|
||||
<string>statusLabel</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UISegmentedControl</string>
|
||||
<string>UIButton</string>
|
||||
<string>UILabel</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>segmentedControl</string>
|
||||
<string>sendButton</string>
|
||||
<string>statusLabel</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">segmentedControl</string>
|
||||
<string key="candidateClassName">UISegmentedControl</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">sendButton</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">statusLabel</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKBackgroundRequestExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// RKCoreDataExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface RKCoreDataExample : UITableViewController {
|
||||
NSArray* _articles;
|
||||
UISegmentedControl* _segmentedControl;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,156 @@
|
||||
//
|
||||
// RKCoreDataExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCoreDataExample.h"
|
||||
|
||||
@interface Article : RKManagedObject {
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSNumber* articleID;
|
||||
@property (nonatomic, retain) NSString* title;
|
||||
@property (nonatomic, retain) NSString* body;
|
||||
|
||||
@end
|
||||
|
||||
@implementation Article
|
||||
|
||||
@dynamic articleID;
|
||||
@dynamic title;
|
||||
@dynamic body;
|
||||
|
||||
+ (NSDictionary*)elementToPropertyMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"id", @"articleID",
|
||||
@"title", @"title",
|
||||
@"body", @"body",
|
||||
nil];
|
||||
}
|
||||
|
||||
+ (NSString*)primaryKeyProperty {
|
||||
return @"articleID";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
|
||||
@implementation RKCoreDataExample
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
RKObjectManager* manager = [RKObjectManager objectManagerWithBaseURL:@"http://restkit.org"];
|
||||
manager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"RKCoreDataExample.sqlite"];
|
||||
[RKObjectManager setSharedManager:manager];
|
||||
|
||||
// Create some starter objects if the database is empty
|
||||
if ([Article count:nil] == 0) {
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
Article* article = [Article object];
|
||||
article.articleID = [NSNumber numberWithInt:i];
|
||||
article.title = [NSString stringWithFormat:@"Article %d", i];
|
||||
article.body = @"This is the body";
|
||||
|
||||
// Persist the object store
|
||||
[manager.objectStore save];
|
||||
}
|
||||
}
|
||||
|
||||
NSArray* items = [NSArray arrayWithObjects:@"All", @"Sorted", @"By Predicate", @"By ID", nil];
|
||||
_segmentedControl = [[UISegmentedControl alloc] initWithItems:items];
|
||||
_segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
|
||||
_segmentedControl.momentary = NO;
|
||||
[_segmentedControl addTarget:self action:@selector(updateTableView) forControlEvents:UIControlEventValueChanged];
|
||||
_segmentedControl.selectedSegmentIndex = 0;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_articles release];
|
||||
[_segmentedControl release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
|
||||
return 35;
|
||||
}
|
||||
|
||||
- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
||||
return _segmentedControl;
|
||||
}
|
||||
|
||||
- (NSFetchRequest*)fetchRequestForSelectedSegment {
|
||||
NSFetchRequest* fetchRequest = [Article fetchRequest];
|
||||
NSPredicate* predicate = nil;
|
||||
|
||||
switch (_segmentedControl.selectedSegmentIndex) {
|
||||
// All objects
|
||||
case 0:
|
||||
// An empty fetch request will return all objects
|
||||
// Duplicates the functionality of [Article allObjects]
|
||||
break;
|
||||
|
||||
// Sorted
|
||||
case 1:;
|
||||
NSSortDescriptor* sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"title" ascending:NO];
|
||||
[fetchRequest setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];
|
||||
break;
|
||||
|
||||
// By Predicate
|
||||
case 2:
|
||||
// Duplicates functionality of calling [Article objectsWithPredicate:predicate];
|
||||
predicate = [NSPredicate predicateWithFormat:@"title CONTAINS[c] %@", @"2"];
|
||||
[fetchRequest setPredicate:predicate];
|
||||
break;
|
||||
|
||||
// By ID
|
||||
case 3:
|
||||
// Duplicates functionality of [Article objectWithPrimaryKeyValue:[NSNumber numberWithInt:3]];
|
||||
predicate = [NSPredicate predicateWithFormat:@"%K = %d", [Article primaryKeyProperty], 3];
|
||||
[fetchRequest setPredicate:predicate];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return fetchRequest;
|
||||
}
|
||||
|
||||
- (void)updateTableView {
|
||||
[_articles release];
|
||||
NSFetchRequest* fetchRequest = [self fetchRequestForSelectedSegment];
|
||||
_articles = [[Article objectsWithFetchRequest:fetchRequest] retain];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return [_articles count];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"ArticleCell"];
|
||||
if (nil == cell) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ArticleCell"] autorelease];
|
||||
}
|
||||
|
||||
Article* article = [_articles objectAtIndex:indexPath.row];
|
||||
cell.textLabel.text = article.title;
|
||||
cell.detailTextLabel.text = article.body;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>_XCCurrentVersionName</key>
|
||||
<string>RKCoreDataExample.xcdatamodel</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUITableView</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUITableView" id="873029372">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">10</int>
|
||||
<object class="NSImage" key="NSImage">
|
||||
<int key="NSImageFlags">549453824</int>
|
||||
<string key="NSSize">{84, 1}</string>
|
||||
<object class="NSMutableArray" key="NSReps">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="0"/>
|
||||
<object class="NSBitmapImageRep">
|
||||
<object class="NSData" key="NSTIFFRepresentation">
|
||||
<bytes key="NS.bytes">TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/
|
||||
y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/
|
||||
xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/
|
||||
xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/
|
||||
xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/
|
||||
xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB
|
||||
AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
|
||||
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS
|
||||
AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MCAwAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">groupTableViewBackgroundColor</string>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<double key="IBUIContentInset.top">5</double>
|
||||
<double key="IBUIContentInset.bottom">0.0</double>
|
||||
<double key="IBUIContentInset.left">5</double>
|
||||
<double key="IBUIContentInset.right">0.0</double>
|
||||
<bool key="IBUIBouncesZoom">NO</bool>
|
||||
<int key="IBUIStyle">1</int>
|
||||
<int key="IBUISeparatorStyle">2</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">44</float>
|
||||
<float key="IBUISectionHeaderHeight">10</float>
|
||||
<float key="IBUISectionFooterHeight">10</float>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="873029372"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">6</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="873029372"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Table View</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>4.IBEditorWindowLastContentRect</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKCoreDataExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{329, 504}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">7</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKCoreDataExample</string>
|
||||
<string key="superclassName">UITableViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKCoreDataExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// RKKeyValueMappingExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface RKKeyValueMappingExample : UIViewController <RKObjectLoaderDelegate> {
|
||||
UILabel* _infoLabel;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UILabel* infoLabel;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// RKKeyValueMappingExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import "RKKeyValueMappingExample.h"
|
||||
|
||||
/**
|
||||
This code is excerpted from the Advanced Tutorial. See Docs/ for explanation
|
||||
*/
|
||||
@interface SimpleAccount : RKObject {
|
||||
NSNumber* _accountID;
|
||||
NSString* _name;
|
||||
NSNumber* _balance;
|
||||
NSNumber* _transactionsCount;
|
||||
NSNumber* _averageTransactionAmount;
|
||||
NSArray* _distinctPayees;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSNumber* accountID;
|
||||
@property (nonatomic, retain) NSString* name;
|
||||
@property (nonatomic, retain) NSNumber* balance;
|
||||
@property (nonatomic, retain) NSNumber* transactionsCount;
|
||||
@property (nonatomic, retain) NSNumber* averageTransactionAmount;
|
||||
@property (nonatomic, retain) NSArray* distinctPayees;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SimpleAccount
|
||||
|
||||
@synthesize accountID = _accountID;
|
||||
@synthesize name = _name;
|
||||
@synthesize balance = _balance;
|
||||
@synthesize transactionsCount = _transactionsCount;
|
||||
@synthesize averageTransactionAmount = _averageTransactionAmount;
|
||||
@synthesize distinctPayees = _distinctPayees;
|
||||
|
||||
+ (NSDictionary*)elementToPropertyMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"id", @"accountID",
|
||||
@"name", @"name",
|
||||
@"balance", @"balance",
|
||||
@"transactions.@count", @"transactionsCount",
|
||||
@"transactions.@avg.amount", @"averageTransactionAmount",
|
||||
@"transactions.@distinctUnionOfObjects.payee", @"distinctPayees",
|
||||
nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
|
||||
@implementation RKKeyValueMappingExample
|
||||
|
||||
@synthesize infoLabel = _infoLabel;
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
[RKObjectManager objectManagerWithBaseURL:gRKCatalogBaseURL];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/RKKeyValueMappingExample" objectClass:[SimpleAccount class] delegate:self];
|
||||
}
|
||||
|
||||
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects {
|
||||
SimpleAccount* account = [objects objectAtIndex:0];
|
||||
|
||||
NSString* info = [NSString stringWithFormat:
|
||||
@"The count is %@\n"
|
||||
@"The average transaction amount is %@\n"
|
||||
@"The distinct list of payees is: %@",
|
||||
[account transactionsCount],
|
||||
[account averageTransactionAmount],
|
||||
[[account distinctPayees] componentsJoinedByString:@", "]];
|
||||
_infoLabel.text = info;
|
||||
}
|
||||
|
||||
- (void)objectLoader:(RKObjectLoader *)objectLoader didFailWithError:(NSError *)error {
|
||||
_infoLabel.text = [NSString stringWithFormat:@"Error: %@", [error localizedDescription]];
|
||||
_infoLabel.textColor = [UIColor redColor];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,274 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUILabel</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUILabel" id="720354125">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{20, 214}, {280, 207}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Loading...</string>
|
||||
<object class="NSFont" key="IBUIFont" id="863589662">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC4zMzMzMzMzMzMzAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">6</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="582963371">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{20, 20}, {280, 139}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="626707256"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">This example has no user interface concerns. The mapping results are displayed below.</string>
|
||||
<reference key="IBUIFont" ref="863589662"/>
|
||||
<object class="NSColor" key="IBUITextColor" id="138216399">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">6</int>
|
||||
<int key="IBUILineBreakMode">0</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="626707256">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{89, 185}, {143, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="720354125"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Mapping Results</string>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">18</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="IBUITextColor" ref="138216399"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="582963371"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">infoLabel</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="720354125"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="582963371"/>
|
||||
<reference ref="720354125"/>
|
||||
<reference ref="626707256"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="720354125"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="582963371"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="626707256"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKKeyValueMappingExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{556, 412}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">7</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKKeyValueMappingExample</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">infoLabel</string>
|
||||
<string key="NS.object.0">UILabel</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">infoLabel</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">infoLabel</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKKeyValueMappingExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// RKParamsExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface RKParamsExample : UIViewController <RKRequestDelegate> {
|
||||
UIProgressView* _progressView;
|
||||
UIActivityIndicatorView* _activityIndicatorView;
|
||||
UIImageView* _imageView;
|
||||
UIButton* _uploadButton;
|
||||
UILabel* _statusLabel;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIProgressView* progressView;
|
||||
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* activityIndicatorView;
|
||||
@property (nonatomic, retain) IBOutlet UIImageView* imageView;
|
||||
@property (nonatomic, retain) IBOutlet UIButton* uploadButton;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* statusLabel;
|
||||
|
||||
- (IBAction)uploadButtonWasTouched:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// RKParamsExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKParamsExample.h"
|
||||
|
||||
@implementation RKParamsExample
|
||||
|
||||
@synthesize progressView = _progressView;
|
||||
@synthesize activityIndicatorView = _activityIndicatorView;
|
||||
@synthesize imageView = _imageView;
|
||||
@synthesize uploadButton = _uploadButton;
|
||||
@synthesize statusLabel = _statusLabel;
|
||||
|
||||
- (IBAction)uploadButtonWasTouched:(id)sender {
|
||||
RKClient* client = [RKClient clientWithBaseURL:gRKCatalogBaseURL];
|
||||
RKParams* params = [RKParams params];
|
||||
|
||||
// Attach the Image from Image View
|
||||
NSLog(@"Got image: %@", [_imageView image]);
|
||||
NSData* imageData = UIImagePNGRepresentation([_imageView image]);
|
||||
[params setData:imageData MIMEType:@"image/png" forParam:@"image1"];
|
||||
|
||||
// Attach an Image from the App Bundle
|
||||
UIImage* image = [UIImage imageNamed:@"RestKit.png"];
|
||||
imageData = UIImagePNGRepresentation(image);
|
||||
[params setData:imageData MIMEType:@"image/png" forParam:@"image2"];
|
||||
|
||||
// Log info about the serialization
|
||||
NSLog(@"RKParams HTTPHeaderValueForContentType = %@", [params HTTPHeaderValueForContentType]);
|
||||
NSLog(@"RKParams HTTPHeaderValueForContentLength = %d", [params HTTPHeaderValueForContentLength]);
|
||||
|
||||
// Send it for processing!
|
||||
[client post:@"/RKParamsExample" params:params delegate:self];
|
||||
}
|
||||
|
||||
- (void)requestDidStartLoad:(RKRequest *)request {
|
||||
_uploadButton.enabled = NO;
|
||||
[_activityIndicatorView startAnimating];
|
||||
}
|
||||
|
||||
- (void)request:(RKRequest *)request didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite {
|
||||
_progressView.progress = (totalBytesWritten / totalBytesExpectedToWrite) * 100.0;
|
||||
}
|
||||
|
||||
- (void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response {
|
||||
_uploadButton.enabled = YES;
|
||||
[_activityIndicatorView stopAnimating];
|
||||
|
||||
if ([response isOK]) {
|
||||
_statusLabel.text = @"Upload Successful!";
|
||||
_statusLabel.textColor = [UIColor greenColor];
|
||||
} else {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Upload failed with status code: %d", [response statusCode]];
|
||||
_statusLabel.textColor = [UIColor redColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error {
|
||||
_uploadButton.enabled = YES;
|
||||
[_activityIndicatorView stopAnimating];
|
||||
_progressView.progress = 0.0;
|
||||
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Upload failed with error: %@", [error localizedDescription]];
|
||||
_statusLabel.textColor = [UIColor redColor];
|
||||
}
|
||||
|
||||
@end
|
||||
412
Examples/RKCatalog/Examples/RKParamsExample/RKParamsExample.xib
Normal file
412
Examples/RKCatalog/Examples/RKParamsExample/RKParamsExample.xib
Normal file
@@ -0,0 +1,412 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBUIProgressView</string>
|
||||
<string>IBUIImageView</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIActivityIndicatorView</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBUIButton</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUIImageView" id="1007844866">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{6, 76}, {306, 71}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="120102345"/>
|
||||
<int key="IBUIContentMode">4</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSCustomResource" key="IBUIImage">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">RestKit.png</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="25478333">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{112, 211}, {123, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="346628087"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Upload Image</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIProgressView" id="120102345">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 170}, {280, 9}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="848504153"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIActivityIndicatorView" id="848504153">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrame">{{84, 220}, {20, 20}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="25478333"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIStyle">2</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="346628087">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{42, 271}, {237, 157}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">12</float>
|
||||
<int key="IBUINumberOfLines">6</int>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1007844866"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">uploadButtonWasTouched:</string>
|
||||
<reference key="source" ref="25478333"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">imageView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="1007844866"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">progressView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="120102345"/>
|
||||
</object>
|
||||
<int key="connectionID">13</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">uploadButton</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="25478333"/>
|
||||
</object>
|
||||
<int key="connectionID">14</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">activityIndicatorView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="848504153"/>
|
||||
</object>
|
||||
<int key="connectionID">15</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">statusLabel</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="346628087"/>
|
||||
</object>
|
||||
<int key="connectionID">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="1007844866"/>
|
||||
<reference ref="120102345"/>
|
||||
<reference ref="25478333"/>
|
||||
<reference ref="848504153"/>
|
||||
<reference ref="346628087"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="1007844866"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">7</int>
|
||||
<reference key="object" ref="25478333"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">8</int>
|
||||
<reference key="object" ref="120102345"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">9</int>
|
||||
<reference key="object" ref="848504153"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">10</int>
|
||||
<reference key="object" ref="346628087"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>10.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
<string>7.IBPluginDependency</string>
|
||||
<string>8.IBPluginDependency</string>
|
||||
<string>9.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKParamsExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{556, 412}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">16</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKParamsExample</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">uploadButtonWasTouched:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">uploadButtonWasTouched:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">uploadButtonWasTouched:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>activityIndicatorView</string>
|
||||
<string>imageView</string>
|
||||
<string>progressView</string>
|
||||
<string>statusLabel</string>
|
||||
<string>uploadButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UIActivityIndicatorView</string>
|
||||
<string>UIImageView</string>
|
||||
<string>UIProgressView</string>
|
||||
<string>UILabel</string>
|
||||
<string>UIButton</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>activityIndicatorView</string>
|
||||
<string>imageView</string>
|
||||
<string>progressView</string>
|
||||
<string>statusLabel</string>
|
||||
<string>uploadButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">activityIndicatorView</string>
|
||||
<string key="candidateClassName">UIActivityIndicatorView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">imageView</string>
|
||||
<string key="candidateClassName">UIImageView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">progressView</string>
|
||||
<string key="candidateClassName">UIProgressView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">statusLabel</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">uploadButton</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKParamsExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<string key="NS.key.0">RestKit.png</string>
|
||||
<string key="NS.object.0">{250, 54}</string>
|
||||
</object>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// RKReachabilityExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface RKReachabilityExample : UIViewController {
|
||||
RKReachabilityObserver* _observer;
|
||||
UILabel* _statusLabel;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UILabel* statusLabel;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// RKReachabilityExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import "RKReachabilityExample.h"
|
||||
|
||||
@implementation RKReachabilityExample
|
||||
|
||||
@synthesize statusLabel = _statusLabel;
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
_observer = [[RKReachabilityObserver reachabilityObserverWithHostName:@"restkit.org"] retain];
|
||||
|
||||
// Register for notifications
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(reachabilityChanged:)
|
||||
name:RKReachabilityStateChangedNotification
|
||||
object:_observer];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[_observer release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)reachabilityChanged:(NSNotification*)notification {
|
||||
RKReachabilityObserver* observer = (RKReachabilityObserver*)[notification object];
|
||||
|
||||
if ([observer isNetworkReachable]) {
|
||||
if ([observer isConnectionRequired]) {
|
||||
_statusLabel.text = @"Connection is available...";
|
||||
_statusLabel.textColor = [UIColor yellowColor];
|
||||
return;
|
||||
}
|
||||
|
||||
_statusLabel.textColor = [UIColor greenColor];
|
||||
|
||||
if (RKReachabilityReachableViaWiFi == [observer networkStatus]) {
|
||||
_statusLabel.text = @"Online via WiFi";
|
||||
} else if (RKReachabilityReachableViaWWAN == [observer networkStatus]) {
|
||||
_statusLabel.text = @"Online via 3G or Edge";
|
||||
}
|
||||
} else {
|
||||
_statusLabel.text = @"Network unreachable!";
|
||||
_statusLabel.textColor = [UIColor redColor];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,265 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUILabel</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUILabel" id="100305367">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{45, 90}, {230, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="544586916"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Reachability Status</string>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUITextColor" id="395729555">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="544586916">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{73, 125}, {174, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="222961625"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<reference key="IBUITextColor" ref="395729555"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
</object>
|
||||
<object class="IBUILabel" id="222961625">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<string key="NSFrame">{{20, 199}, {273, 105}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">A reachability observer has been installed. Try disconnecting and reconnecting your Airport to see status change.</string>
|
||||
<reference key="IBUITextColor" ref="395729555"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">5</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="100305367"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">statusLabel</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="544586916"/>
|
||||
</object>
|
||||
<int key="connectionID">8</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="100305367"/>
|
||||
<reference ref="544586916"/>
|
||||
<reference ref="222961625"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="100305367"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="544586916"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="222961625"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKReachabilityExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{556, 412}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">8</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKReachabilityExample</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">statusLabel</string>
|
||||
<string key="NS.object.0">UILabel</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">statusLabel</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">statusLabel</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKReachabilityExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Project.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
#import "User.h"
|
||||
|
||||
@interface Project : RKObject {
|
||||
NSNumber* _projectID;
|
||||
NSString* _name;
|
||||
NSString* _description;
|
||||
User* _user;
|
||||
NSArray* _tasks;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSNumber* projectID;
|
||||
@property (nonatomic, retain) NSString* name;
|
||||
@property (nonatomic, retain) NSString* description;
|
||||
@property (nonatomic, retain) User* user;
|
||||
@property (nonatomic, retain) NSArray* tasks;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Project.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Project.h"
|
||||
|
||||
@implementation Project
|
||||
|
||||
@synthesize projectID = _projectID;
|
||||
@synthesize name = _name;
|
||||
@synthesize description = _description;
|
||||
@synthesize user = _user;
|
||||
@synthesize tasks = _tasks;
|
||||
|
||||
+ (NSDictionary*)elementToPropertyMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"id", @"projectID",
|
||||
@"name", @"name",
|
||||
@"description", @"description",
|
||||
nil];
|
||||
}
|
||||
|
||||
+ (NSDictionary*)elementToRelationshipMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"user", @"user",
|
||||
@"tasks", @"tasks",
|
||||
nil];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// RKRelationshipMappingExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
#import "Project.h"
|
||||
|
||||
@interface RKRelationshipMappingExample : UITableViewController <RKObjectLoaderDelegate, UITableViewDelegate> {
|
||||
Project* _selectedProject;
|
||||
NSArray* _objects;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,133 @@
|
||||
//
|
||||
// RKRelationshipMappingExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import <RestKit/CoreData/CoreData.h>
|
||||
#import "RKRelationshipMappingExample.h"
|
||||
#import "User.h"
|
||||
#import "Project.h"
|
||||
#import "Task.h"
|
||||
|
||||
@implementation RKRelationshipMappingExample
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:gRKCatalogBaseURL];
|
||||
objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"RKRelationshipMappingExample.sqlite"];
|
||||
[objectManager registerClass:[User class] forElementNamed:@"user"];
|
||||
[objectManager registerClass:[Project class] forElementNamed:@"project"];
|
||||
[objectManager registerClass:[Task class] forElementNamed:@"tasks"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_objects release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
self.title = @"Task List";
|
||||
|
||||
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/RKRelationshipMappingExample" delegate:self];
|
||||
}
|
||||
|
||||
- (void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects {
|
||||
_objects = [objects retain];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)objectLoader:(RKObjectLoader *)objectLoader didFailWithError:(NSError *)error {
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Rats!" otherButtonTitles:nil];
|
||||
[alert show];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 2;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
if (section == 0) {
|
||||
// Return number of projects
|
||||
return [_objects count];
|
||||
} else {
|
||||
// Return number of tasks in the selected project...
|
||||
NSIndexPath* indexPath = [self.tableView indexPathForSelectedRow];
|
||||
if (indexPath) {
|
||||
return [[[_objects objectAtIndex:indexPath.row] tasks] count];
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
||||
UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 150, 100)];
|
||||
label.backgroundColor = [UIColor clearColor];
|
||||
label.font = [UIFont boldSystemFontOfSize:18];
|
||||
|
||||
if (section == 0) {
|
||||
label.text = @"Projects";
|
||||
} else if (section == 1) {
|
||||
label.text = @"Tasks";
|
||||
}
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
#pragma mark - Table View Selection
|
||||
|
||||
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
// Don't allow selections in the bottom section
|
||||
if (indexPath.section == 1) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[_selectedProject release];
|
||||
_selectedProject = [[_objects objectAtIndex:indexPath.row] retain];
|
||||
|
||||
[self.tableView reloadData];
|
||||
UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
static NSString *CellIdentifier = @"Cell";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
if (cell == nil) {
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
|
||||
}
|
||||
|
||||
if (indexPath.section == 0) {
|
||||
Project* project = (Project*) [_objects objectAtIndex:indexPath.row];
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
cell.textLabel.text = project.name;
|
||||
} else if (indexPath.section == 1) {
|
||||
// NOTE: We refetch the object here because Project is not Core Data backed
|
||||
NSManagedObject* objectReference = [_selectedProject.tasks objectAtIndex:indexPath.row];
|
||||
Task* task = (Task*) [[RKObjectManager sharedManager].objectStore objectWithID:[objectReference objectID]];
|
||||
cell.textLabel.text = [NSString stringWithFormat:@"%@", task.name];
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"Assigned to: %@", task.assignedUser.name];
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>_XCCurrentVersionName</key>
|
||||
<string>RKRelationshipMappingExample.xcdatamodel</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,202 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUITableView</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUITableView" id="873029372">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">10</int>
|
||||
<object class="NSImage" key="NSImage">
|
||||
<int key="NSImageFlags">549453824</int>
|
||||
<string key="NSSize">{84, 1}</string>
|
||||
<object class="NSMutableArray" key="NSReps">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="0"/>
|
||||
<object class="NSBitmapImageRep">
|
||||
<object class="NSData" key="NSTIFFRepresentation">
|
||||
<bytes key="NS.bytes">TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/
|
||||
y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/
|
||||
xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/
|
||||
xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/
|
||||
xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/
|
||||
xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB
|
||||
AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
|
||||
AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS
|
||||
AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MCAwAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">groupTableViewBackgroundColor</string>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIBouncesZoom">NO</bool>
|
||||
<int key="IBUIStyle">1</int>
|
||||
<int key="IBUISeparatorStyle">2</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">44</float>
|
||||
<float key="IBUISectionHeaderHeight">25</float>
|
||||
<float key="IBUISectionFooterHeight">10</float>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="873029372"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">6</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="873029372"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>4.IBEditorWindowLastContentRect</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKRelationshipMappingExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{329, 504}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">7</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKRelationshipMappingExample</string>
|
||||
<string key="superclassName">UITableViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKRelationshipMappingExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Task.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
#import "User.h"
|
||||
|
||||
@interface Task : RKManagedObject {
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSString* name;
|
||||
@property (nonatomic, retain) NSNumber* taskID;
|
||||
@property (nonatomic, retain) NSNumber* assignedUserID;
|
||||
@property (nonatomic, retain) User* assignedUser;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Task.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Task.h"
|
||||
|
||||
@implementation Task
|
||||
|
||||
@dynamic name;
|
||||
@dynamic taskID;
|
||||
@dynamic assignedUserID;
|
||||
@dynamic assignedUser;
|
||||
|
||||
+ (NSDictionary*)elementToPropertyMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"id", @"taskID",
|
||||
@"name", @"name",
|
||||
@"assigned_user_id", @"assignedUserID",
|
||||
nil];
|
||||
}
|
||||
|
||||
+ (NSString*)primaryKeyProperty {
|
||||
return @"taskID";
|
||||
}
|
||||
|
||||
+ (NSDictionary*)relationshipToPrimaryKeyPropertyMappings {
|
||||
return [NSDictionary dictionaryWithObject:@"assignedUserID" forKey:@"assignedUser"];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// User.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface User : RKManagedObject {
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSNumber* userID;
|
||||
@property (nonatomic, retain) NSString* name;
|
||||
@property (nonatomic, retain) NSString* email;
|
||||
@property (nonatomic, retain) NSSet* tasks;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// User.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "User.h"
|
||||
|
||||
@implementation User
|
||||
|
||||
@dynamic userID;
|
||||
@dynamic name;
|
||||
@dynamic email;
|
||||
@dynamic tasks;
|
||||
|
||||
+ (NSDictionary*)elementToPropertyMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"id", @"userID",
|
||||
@"name", @"name",
|
||||
@"email", @"email",
|
||||
nil];
|
||||
}
|
||||
|
||||
+ (NSString*)primaryKeyProperty {
|
||||
return @"userID";
|
||||
}
|
||||
|
||||
+ (NSDictionary*)elementToRelationshipMappings {
|
||||
return [NSDictionary dictionaryWithKeysAndObjects:
|
||||
@"tasks", @"tasks",
|
||||
nil];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// RKRequestQueueExample.h
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKCatalog.h"
|
||||
|
||||
@interface RKRequestQueueExample : UIViewController <RKRequestQueueDelegate, RKRequestDelegate> {
|
||||
UILabel* _statusLabel;
|
||||
RKRequestQueue* _queue;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) RKRequestQueue* queue;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* statusLabel;
|
||||
|
||||
- (IBAction)sendRequest;
|
||||
- (IBAction)queueRequests;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// RKRequestQueueExample.m
|
||||
// RKCatalog
|
||||
//
|
||||
// Created by Blake Watters on 4/21/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <RestKit/RestKit.h>
|
||||
#import "RKRequestQueueExample.h"
|
||||
|
||||
@implementation RKRequestQueueExample
|
||||
|
||||
@synthesize queue = _queue;
|
||||
@synthesize statusLabel = _statusLabel;
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
RKClient* client = [RKClient clientWithBaseURL:gRKCatalogBaseURL];
|
||||
[RKClient setSharedClient:client];
|
||||
|
||||
// Ask RestKit to spin the network activity indicator for us
|
||||
[RKRequestQueue sharedQueue].delegate = self;
|
||||
[RKRequestQueue sharedQueue].showsNetworkActivityIndicatorWhenBusy = YES;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
// We have been dismissed -- clean up any open requests
|
||||
- (void)dealloc {
|
||||
[[RKRequestQueue sharedQueue] cancelRequestsWithDelegate:self];
|
||||
[_queue release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// We have been obscured -- cancel any pending requests
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[[RKRequestQueue sharedQueue] cancelRequestsWithDelegate:self];
|
||||
}
|
||||
|
||||
- (IBAction)sendRequest {
|
||||
/**
|
||||
* Ask RKClient to load us some data. This causes an RKRequest object to be created
|
||||
* transparently pushed onto the RKRequestQueue sharedQueue instance
|
||||
*/
|
||||
[[RKClient sharedClient] get:@"/RKRequestQueueExample" delegate:self];
|
||||
}
|
||||
|
||||
- (IBAction)queueRequests {
|
||||
RKRequestQueue* queue = [[RKRequestQueue alloc] init];
|
||||
queue.delegate = self;
|
||||
queue.concurrentRequestsLimit = 1;
|
||||
queue.showsNetworkActivityIndicatorWhenBusy = YES;
|
||||
|
||||
// Queue up 4 requests
|
||||
[queue addRequest:[[RKClient sharedClient] requestWithResourcePath:@"/RKRequestQueueExample" delegate:self]];
|
||||
[queue addRequest:[[RKClient sharedClient] requestWithResourcePath:@"/RKRequestQueueExample" delegate:self]];
|
||||
[queue addRequest:[[RKClient sharedClient] requestWithResourcePath:@"/RKRequestQueueExample" delegate:self]];
|
||||
[queue addRequest:[[RKClient sharedClient] requestWithResourcePath:@"/RKRequestQueueExample" delegate:self]];
|
||||
|
||||
// Start processing!
|
||||
[queue start];
|
||||
|
||||
// Manage memory for our ad-hoc queue
|
||||
self.queue = queue;
|
||||
[queue release];
|
||||
}
|
||||
|
||||
- (void)requestQueue:(RKRequestQueue *)queue didSendRequest:(RKRequest *)request {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"RKRequestQueue %@ sharedQueue is current loading %d of %d requests",
|
||||
queue, [queue loadingCount], [queue count]];
|
||||
}
|
||||
|
||||
- (void)requestQueueDidBeginLoading:(RKRequestQueue *)queue {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Queue %@ Began Loading...", queue];
|
||||
}
|
||||
|
||||
- (void)requestQueueDidFinishLoading:(RKRequestQueue *)queue {
|
||||
_statusLabel.text = [NSString stringWithFormat:@"Queue %@ Finished Loading...", queue];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,362 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1306</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">301</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBProxyObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUILabel" id="680819565">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 165}, {273, 60}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="568352623"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">12</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUITextColor" id="1010756065">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">3</int>
|
||||
</object>
|
||||
<object class="IBUIButton" id="568352623">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{33, 246}, {125, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="60229402"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<object class="NSFont" key="IBUIFont" id="951085566">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Send Request</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor" id="326019905">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor" id="126261494">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="60229402">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{171, 246}, {122, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<reference key="IBUIFont" ref="951085566"/>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Create Queue</string>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="326019905"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="126261494"/>
|
||||
</object>
|
||||
<object class="IBUILabel" id="135589653">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">304</int>
|
||||
<string key="NSFrame">{{20, 57}, {280, 100}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="680819565"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">This example highlights RestKit queue handling. Use the buttons to cause queues to be manipulated.</string>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<reference key="IBUITextColor" ref="1010756065"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUINumberOfLines">3</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="135589653"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">statusLabel</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="680819565"/>
|
||||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">sendRequest</string>
|
||||
<reference key="source" ref="568352623"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">queueRequests</string>
|
||||
<reference key="source" ref="60229402"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">13</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="135589653"/>
|
||||
<reference ref="680819565"/>
|
||||
<reference ref="568352623"/>
|
||||
<reference ref="60229402"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="680819565"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="568352623"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="60229402"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">7</int>
|
||||
<reference key="object" ref="135589653"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>5.IBPluginDependency</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
<string>7.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>RKRequestQueueExample</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{556, 412}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">13</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RKRequestQueueExample</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>queueRequests</string>
|
||||
<string>sendRequest</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>queueRequests</string>
|
||||
<string>sendRequest</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">queueRequests</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">sendRequest</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">statusLabel</string>
|
||||
<string key="NS.object.0">UILabel</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">statusLabel</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">statusLabel</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/RKRequestQueueExample.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">301</string>
|
||||
</data>
|
||||
</archive>
|
||||
717
Examples/RKCatalog/RKCatalog.xcodeproj/project.pbxproj
Normal file
717
Examples/RKCatalog/RKCatalog.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,717 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2501DE5D13607B67003DE9E4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2501DE5C13607B67003DE9E4 /* UIKit.framework */; };
|
||||
2501DE5F13607B67003DE9E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2501DE5E13607B67003DE9E4 /* Foundation.framework */; };
|
||||
2501DE6113607B67003DE9E4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2501DE6013607B67003DE9E4 /* CoreGraphics.framework */; };
|
||||
2501DE6313607B67003DE9E4 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2501DE6213607B67003DE9E4 /* CoreData.framework */; };
|
||||
256F388C1361053900CE0C58 /* RKKeyValueMappingExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 256F388A1361053900CE0C58 /* RKKeyValueMappingExample.m */; };
|
||||
256F388D1361053900CE0C58 /* RKKeyValueMappingExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 256F388B1361053900CE0C58 /* RKKeyValueMappingExample.xib */; };
|
||||
256F38971361188700CE0C58 /* RKRelationshipMappingExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 256F38951361188700CE0C58 /* RKRelationshipMappingExample.m */; };
|
||||
256F38981361188700CE0C58 /* RKRelationshipMappingExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 256F38961361188700CE0C58 /* RKRelationshipMappingExample.xib */; };
|
||||
256F389B13611B5E00CE0C58 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 256F389A13611B5E00CE0C58 /* User.m */; };
|
||||
256F389E13611B6700CE0C58 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 256F389D13611B6700CE0C58 /* Task.m */; };
|
||||
256F38A113611B7200CE0C58 /* Project.m in Sources */ = {isa = PBXBuildFile; fileRef = 256F38A013611B7200CE0C58 /* Project.m */; };
|
||||
256F38AE13612E9400CE0C58 /* RKCoreDataExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 256F38AC13612E9400CE0C58 /* RKCoreDataExample.m */; };
|
||||
256F38AF13612E9400CE0C58 /* RKCoreDataExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 256F38AD13612E9400CE0C58 /* RKCoreDataExample.xib */; };
|
||||
25825DF31361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 25825DF11361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodeld */; };
|
||||
258BAA4813608BDB00ED0614 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 258BAA3513608BDB00ED0614 /* InfoPlist.strings */; };
|
||||
258BAA4913608BDB00ED0614 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 258BAA3713608BDB00ED0614 /* MainWindow.xib */; };
|
||||
258BAA4A13608BDB00ED0614 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 258BAA3913608BDB00ED0614 /* RootViewController.xib */; };
|
||||
258BAA4B13608BDB00ED0614 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAA3B13608BDB00ED0614 /* main.m */; };
|
||||
258BAA4D13608BDB00ED0614 /* RKCatalogAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAA3F13608BDB00ED0614 /* RKCatalogAppDelegate.m */; };
|
||||
258BAA4E13608BDB00ED0614 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAA4113608BDB00ED0614 /* RootViewController.m */; };
|
||||
258BAA4F13608BDB00ED0614 /* RestKit.png in Resources */ = {isa = PBXBuildFile; fileRef = 258BAA4413608BDB00ED0614 /* RestKit.png */; };
|
||||
258BAA5013608BDB00ED0614 /* RKParamsExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAA4613608BDB00ED0614 /* RKParamsExample.m */; };
|
||||
258BAA5113608BDB00ED0614 /* RKParamsExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 258BAA4713608BDB00ED0614 /* RKParamsExample.xib */; };
|
||||
258BAA5813609F4B00ED0614 /* libRestKitCoreData.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5213609F4B00ED0614 /* libRestKitCoreData.a */; };
|
||||
258BAA5913609F4B00ED0614 /* libRestKitJSONParserJSONKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5313609F4B00ED0614 /* libRestKitJSONParserJSONKit.a */; };
|
||||
258BAA5A13609F4B00ED0614 /* libRestKitNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5413609F4B00ED0614 /* libRestKitNetwork.a */; };
|
||||
258BAA5B13609F4B00ED0614 /* libRestKitObjectMapping.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5513609F4B00ED0614 /* libRestKitObjectMapping.a */; };
|
||||
258BAA5C13609F4B00ED0614 /* libRestKitSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5613609F4B00ED0614 /* libRestKitSupport.a */; };
|
||||
258BAA5D13609F4B00ED0614 /* libRestKitXMLParserLibxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5713609F4B00ED0614 /* libRestKitXMLParserLibxml.a */; };
|
||||
258BAA5F13609F5200ED0614 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA5E13609F5200ED0614 /* libxml2.dylib */; };
|
||||
258BAA6113609F5D00ED0614 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA6013609F5D00ED0614 /* SystemConfiguration.framework */; };
|
||||
258BAA6313609F6400ED0614 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA6213609F6400ED0614 /* CFNetwork.framework */; };
|
||||
258BAA6513609F6D00ED0614 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 258BAA6413609F6D00ED0614 /* MobileCoreServices.framework */; };
|
||||
258BAA6A1360AF8200ED0614 /* RKRequestQueueExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAA681360AF8200ED0614 /* RKRequestQueueExample.m */; };
|
||||
258BAA6B1360AF8200ED0614 /* RKRequestQueueExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 258BAA691360AF8200ED0614 /* RKRequestQueueExample.xib */; };
|
||||
258BAAEF1360BB3800ED0614 /* RKReachabilityExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAAED1360BB3800ED0614 /* RKReachabilityExample.m */; };
|
||||
258BAAF01360BB3800ED0614 /* RKReachabilityExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 258BAAEE1360BB3800ED0614 /* RKReachabilityExample.xib */; };
|
||||
258BAAF51360C15900ED0614 /* RKBackgroundRequestExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 258BAAF31360C15900ED0614 /* RKBackgroundRequestExample.m */; };
|
||||
258BAAF61360C15900ED0614 /* RKBackgroundRequestExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 258BAAF41360C15900ED0614 /* RKBackgroundRequestExample.xib */; };
|
||||
258E219C1361BC42000D4DCF /* RKCoreDataExample.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 258E219A1361BC42000D4DCF /* RKCoreDataExample.xcdatamodeld */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
2501DEA013607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 253A07FC1255161B00976E89;
|
||||
remoteInfo = RestKitNetwork;
|
||||
};
|
||||
2501DEA213607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 253A08031255162C00976E89;
|
||||
remoteInfo = RestKitObjectMapping;
|
||||
};
|
||||
2501DEA413607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 253A080C12551D3000976E89;
|
||||
remoteInfo = RestKitSupport;
|
||||
};
|
||||
2501DEA613607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2590E64F125231F600531FA8;
|
||||
remoteInfo = "RestKitJSONParser+YAJL";
|
||||
};
|
||||
2501DEA813607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2590E66B1252353700531FA8;
|
||||
remoteInfo = "RestKitJSONParser+SBJSON";
|
||||
};
|
||||
2501DEAA13607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 73057FD11331AD2E001908EE;
|
||||
remoteInfo = "RestKitJSONParser+JSONKit";
|
||||
};
|
||||
2501DEAC13607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 25BD43BD1340315800DBACDD;
|
||||
remoteInfo = "RestKitXMLParser+Libxml";
|
||||
};
|
||||
2501DEAE13607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 253A081412551D5300976E89;
|
||||
remoteInfo = RestKitCoreData;
|
||||
};
|
||||
2501DEB013607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2523360511E79F090048F9B4;
|
||||
remoteInfo = RestKitThree20;
|
||||
};
|
||||
2501DEB213607B74003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 3F6C39A510FE5C95008F47C5;
|
||||
remoteInfo = UISpec;
|
||||
};
|
||||
2501DEB913607BD5003DE9E4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 255B7588133BABBF00ED76AD;
|
||||
remoteInfo = RestKit;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2501DE5813607B67003DE9E4 /* RKCatalog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKCatalog.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2501DE5C13607B67003DE9E4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
2501DE5E13607B67003DE9E4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
2501DE6013607B67003DE9E4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
2501DE6213607B67003DE9E4 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = "<group>"; };
|
||||
256F38891361053900CE0C58 /* RKKeyValueMappingExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKKeyValueMappingExample.h; sourceTree = "<group>"; };
|
||||
256F388A1361053900CE0C58 /* RKKeyValueMappingExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKKeyValueMappingExample.m; sourceTree = "<group>"; };
|
||||
256F388B1361053900CE0C58 /* RKKeyValueMappingExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKKeyValueMappingExample.xib; sourceTree = "<group>"; };
|
||||
256F38941361188700CE0C58 /* RKRelationshipMappingExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKRelationshipMappingExample.h; sourceTree = "<group>"; };
|
||||
256F38951361188700CE0C58 /* RKRelationshipMappingExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKRelationshipMappingExample.m; sourceTree = "<group>"; };
|
||||
256F38961361188700CE0C58 /* RKRelationshipMappingExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKRelationshipMappingExample.xib; sourceTree = "<group>"; };
|
||||
256F389913611B5E00CE0C58 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
|
||||
256F389A13611B5E00CE0C58 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
|
||||
256F389C13611B6700CE0C58 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = "<group>"; };
|
||||
256F389D13611B6700CE0C58 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = "<group>"; };
|
||||
256F389F13611B7200CE0C58 /* Project.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Project.h; sourceTree = "<group>"; };
|
||||
256F38A013611B7200CE0C58 /* Project.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Project.m; sourceTree = "<group>"; };
|
||||
256F38AB13612E9400CE0C58 /* RKCoreDataExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKCoreDataExample.h; sourceTree = "<group>"; };
|
||||
256F38AC13612E9400CE0C58 /* RKCoreDataExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKCoreDataExample.m; sourceTree = "<group>"; };
|
||||
256F38AD13612E9400CE0C58 /* RKCoreDataExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKCoreDataExample.xib; sourceTree = "<group>"; };
|
||||
25825DF21361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = RKRelationshipMappingExample.xcdatamodel; sourceTree = "<group>"; };
|
||||
258BAA3613608BDB00ED0614 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
258BAA3813608BDB00ED0614 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
|
||||
258BAA3A13608BDB00ED0614 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/RootViewController.xib; sourceTree = "<group>"; };
|
||||
258BAA3B13608BDB00ED0614 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
258BAA3C13608BDB00ED0614 /* RKCatalog-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "RKCatalog-Info.plist"; sourceTree = "<group>"; };
|
||||
258BAA3D13608BDB00ED0614 /* RKCatalog-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RKCatalog-Prefix.pch"; sourceTree = "<group>"; };
|
||||
258BAA3E13608BDB00ED0614 /* RKCatalogAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKCatalogAppDelegate.h; sourceTree = "<group>"; };
|
||||
258BAA3F13608BDB00ED0614 /* RKCatalogAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKCatalogAppDelegate.m; sourceTree = "<group>"; };
|
||||
258BAA4013608BDB00ED0614 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = "<group>"; };
|
||||
258BAA4113608BDB00ED0614 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = "<group>"; };
|
||||
258BAA4413608BDB00ED0614 /* RestKit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = RestKit.png; sourceTree = "<group>"; };
|
||||
258BAA4513608BDB00ED0614 /* RKParamsExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKParamsExample.h; sourceTree = "<group>"; };
|
||||
258BAA4613608BDB00ED0614 /* RKParamsExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKParamsExample.m; sourceTree = "<group>"; };
|
||||
258BAA4713608BDB00ED0614 /* RKParamsExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKParamsExample.xib; sourceTree = "<group>"; };
|
||||
258BAA5213609F4B00ED0614 /* libRestKitCoreData.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitCoreData.a; sourceTree = SOURCE_ROOT; };
|
||||
258BAA5313609F4B00ED0614 /* libRestKitJSONParserJSONKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitJSONParserJSONKit.a; sourceTree = SOURCE_ROOT; };
|
||||
258BAA5413609F4B00ED0614 /* libRestKitNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitNetwork.a; sourceTree = SOURCE_ROOT; };
|
||||
258BAA5513609F4B00ED0614 /* libRestKitObjectMapping.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitObjectMapping.a; sourceTree = SOURCE_ROOT; };
|
||||
258BAA5613609F4B00ED0614 /* libRestKitSupport.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitSupport.a; sourceTree = SOURCE_ROOT; };
|
||||
258BAA5713609F4B00ED0614 /* libRestKitXMLParserLibxml.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitXMLParserLibxml.a; sourceTree = SOURCE_ROOT; };
|
||||
258BAA5E13609F5200ED0614 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
|
||||
258BAA6013609F5D00ED0614 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
258BAA6213609F6400ED0614 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
|
||||
258BAA6413609F6D00ED0614 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
|
||||
258BAA671360AF8200ED0614 /* RKRequestQueueExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKRequestQueueExample.h; sourceTree = "<group>"; };
|
||||
258BAA681360AF8200ED0614 /* RKRequestQueueExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKRequestQueueExample.m; sourceTree = "<group>"; };
|
||||
258BAA691360AF8200ED0614 /* RKRequestQueueExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKRequestQueueExample.xib; sourceTree = "<group>"; };
|
||||
258BAA6C1360AFC800ED0614 /* RKCatalog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKCatalog.h; sourceTree = "<group>"; };
|
||||
258BAAEC1360BB3800ED0614 /* RKReachabilityExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKReachabilityExample.h; sourceTree = "<group>"; };
|
||||
258BAAED1360BB3800ED0614 /* RKReachabilityExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKReachabilityExample.m; sourceTree = "<group>"; };
|
||||
258BAAEE1360BB3800ED0614 /* RKReachabilityExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKReachabilityExample.xib; sourceTree = "<group>"; };
|
||||
258BAAF21360C15900ED0614 /* RKBackgroundRequestExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKBackgroundRequestExample.h; sourceTree = "<group>"; };
|
||||
258BAAF31360C15900ED0614 /* RKBackgroundRequestExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKBackgroundRequestExample.m; sourceTree = "<group>"; };
|
||||
258BAAF41360C15900ED0614 /* RKBackgroundRequestExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RKBackgroundRequestExample.xib; sourceTree = "<group>"; };
|
||||
258E219B1361BC42000D4DCF /* RKCoreDataExample.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = RKCoreDataExample.xcdatamodel; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2501DE5513607B67003DE9E4 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
258BAA6513609F6D00ED0614 /* MobileCoreServices.framework in Frameworks */,
|
||||
258BAA6313609F6400ED0614 /* CFNetwork.framework in Frameworks */,
|
||||
258BAA6113609F5D00ED0614 /* SystemConfiguration.framework in Frameworks */,
|
||||
258BAA5F13609F5200ED0614 /* libxml2.dylib in Frameworks */,
|
||||
258BAA5813609F4B00ED0614 /* libRestKitCoreData.a in Frameworks */,
|
||||
258BAA5913609F4B00ED0614 /* libRestKitJSONParserJSONKit.a in Frameworks */,
|
||||
258BAA5A13609F4B00ED0614 /* libRestKitNetwork.a in Frameworks */,
|
||||
258BAA5B13609F4B00ED0614 /* libRestKitObjectMapping.a in Frameworks */,
|
||||
258BAA5C13609F4B00ED0614 /* libRestKitSupport.a in Frameworks */,
|
||||
258BAA5D13609F4B00ED0614 /* libRestKitXMLParserLibxml.a in Frameworks */,
|
||||
2501DE5D13607B67003DE9E4 /* UIKit.framework in Frameworks */,
|
||||
2501DE5F13607B67003DE9E4 /* Foundation.framework in Frameworks */,
|
||||
2501DE6113607B67003DE9E4 /* CoreGraphics.framework in Frameworks */,
|
||||
2501DE6313607B67003DE9E4 /* CoreData.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2501DE4D13607B67003DE9E4 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAA3413608BDB00ED0614 /* App */,
|
||||
258BAA4213608BDB00ED0614 /* Examples */,
|
||||
2501DE5B13607B67003DE9E4 /* Frameworks */,
|
||||
2501DE5913607B67003DE9E4 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2501DE5913607B67003DE9E4 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2501DE5813607B67003DE9E4 /* RKCatalog.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2501DE5B13607B67003DE9E4 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAA6413609F6D00ED0614 /* MobileCoreServices.framework */,
|
||||
258BAA6213609F6400ED0614 /* CFNetwork.framework */,
|
||||
258BAA6013609F5D00ED0614 /* SystemConfiguration.framework */,
|
||||
258BAA5E13609F5200ED0614 /* libxml2.dylib */,
|
||||
258BAA5213609F4B00ED0614 /* libRestKitCoreData.a */,
|
||||
258BAA5313609F4B00ED0614 /* libRestKitJSONParserJSONKit.a */,
|
||||
258BAA5413609F4B00ED0614 /* libRestKitNetwork.a */,
|
||||
258BAA5513609F4B00ED0614 /* libRestKitObjectMapping.a */,
|
||||
258BAA5613609F4B00ED0614 /* libRestKitSupport.a */,
|
||||
258BAA5713609F4B00ED0614 /* libRestKitXMLParserLibxml.a */,
|
||||
2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */,
|
||||
2501DE5C13607B67003DE9E4 /* UIKit.framework */,
|
||||
2501DE5E13607B67003DE9E4 /* Foundation.framework */,
|
||||
2501DE6013607B67003DE9E4 /* CoreGraphics.framework */,
|
||||
2501DE6213607B67003DE9E4 /* CoreData.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2501DE8213607B74003DE9E4 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2501DEA113607B74003DE9E4 /* libRestKitNetwork.a */,
|
||||
2501DEA313607B74003DE9E4 /* libRestKitObjectMapping.a */,
|
||||
2501DEA513607B74003DE9E4 /* libRestKitSupport.a */,
|
||||
2501DEA713607B74003DE9E4 /* libRestKitJSONParserYAJL.a */,
|
||||
2501DEA913607B74003DE9E4 /* libRestKitJSONParserSBJSON.a */,
|
||||
2501DEAB13607B74003DE9E4 /* libRestKitJSONParserJSONKit.a */,
|
||||
2501DEAD13607B74003DE9E4 /* libRestKitXMLParserLibxml.a */,
|
||||
2501DEAF13607B74003DE9E4 /* libRestKitCoreData.a */,
|
||||
2501DEB113607B74003DE9E4 /* libRestKitThree20.a */,
|
||||
2501DEB313607B74003DE9E4 /* UISpec.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
256F38881361052C00CE0C58 /* RKKeyValueMappingExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
256F38891361053900CE0C58 /* RKKeyValueMappingExample.h */,
|
||||
256F388A1361053900CE0C58 /* RKKeyValueMappingExample.m */,
|
||||
256F388B1361053900CE0C58 /* RKKeyValueMappingExample.xib */,
|
||||
);
|
||||
path = RKKeyValueMappingExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
256F388E136116C200CE0C58 /* RKRelationshipMappingExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
256F38941361188700CE0C58 /* RKRelationshipMappingExample.h */,
|
||||
256F38951361188700CE0C58 /* RKRelationshipMappingExample.m */,
|
||||
256F38961361188700CE0C58 /* RKRelationshipMappingExample.xib */,
|
||||
256F389913611B5E00CE0C58 /* User.h */,
|
||||
256F389A13611B5E00CE0C58 /* User.m */,
|
||||
256F389C13611B6700CE0C58 /* Task.h */,
|
||||
256F389D13611B6700CE0C58 /* Task.m */,
|
||||
256F389F13611B7200CE0C58 /* Project.h */,
|
||||
256F38A013611B7200CE0C58 /* Project.m */,
|
||||
25825DF11361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodeld */,
|
||||
);
|
||||
path = RKRelationshipMappingExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
256F38A21361286400CE0C58 /* RKCoreDataExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258E219A1361BC42000D4DCF /* RKCoreDataExample.xcdatamodeld */,
|
||||
256F38AB13612E9400CE0C58 /* RKCoreDataExample.h */,
|
||||
256F38AC13612E9400CE0C58 /* RKCoreDataExample.m */,
|
||||
256F38AD13612E9400CE0C58 /* RKCoreDataExample.xib */,
|
||||
);
|
||||
path = RKCoreDataExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAA3413608BDB00ED0614 /* App */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAA3513608BDB00ED0614 /* InfoPlist.strings */,
|
||||
258BAA3713608BDB00ED0614 /* MainWindow.xib */,
|
||||
258BAA3913608BDB00ED0614 /* RootViewController.xib */,
|
||||
258BAA3B13608BDB00ED0614 /* main.m */,
|
||||
258BAA3C13608BDB00ED0614 /* RKCatalog-Info.plist */,
|
||||
258BAA3D13608BDB00ED0614 /* RKCatalog-Prefix.pch */,
|
||||
258BAA3E13608BDB00ED0614 /* RKCatalogAppDelegate.h */,
|
||||
258BAA3F13608BDB00ED0614 /* RKCatalogAppDelegate.m */,
|
||||
258BAA4013608BDB00ED0614 /* RootViewController.h */,
|
||||
258BAA4113608BDB00ED0614 /* RootViewController.m */,
|
||||
258BAA6C1360AFC800ED0614 /* RKCatalog.h */,
|
||||
);
|
||||
path = App;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAA4213608BDB00ED0614 /* Examples */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAA4313608BDB00ED0614 /* RKParamsExample */,
|
||||
258BAA661360AF7000ED0614 /* RKRequestQueueExample */,
|
||||
258BAAEB1360BB0300ED0614 /* RKReachabilityExample */,
|
||||
258BAAF11360C0FE00ED0614 /* RKBackgroundRequestExample */,
|
||||
256F38881361052C00CE0C58 /* RKKeyValueMappingExample */,
|
||||
256F388E136116C200CE0C58 /* RKRelationshipMappingExample */,
|
||||
256F38A21361286400CE0C58 /* RKCoreDataExample */,
|
||||
);
|
||||
path = Examples;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAA4313608BDB00ED0614 /* RKParamsExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAA4413608BDB00ED0614 /* RestKit.png */,
|
||||
258BAA4513608BDB00ED0614 /* RKParamsExample.h */,
|
||||
258BAA4613608BDB00ED0614 /* RKParamsExample.m */,
|
||||
258BAA4713608BDB00ED0614 /* RKParamsExample.xib */,
|
||||
);
|
||||
path = RKParamsExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAA661360AF7000ED0614 /* RKRequestQueueExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAA671360AF8200ED0614 /* RKRequestQueueExample.h */,
|
||||
258BAA681360AF8200ED0614 /* RKRequestQueueExample.m */,
|
||||
258BAA691360AF8200ED0614 /* RKRequestQueueExample.xib */,
|
||||
);
|
||||
path = RKRequestQueueExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAAEB1360BB0300ED0614 /* RKReachabilityExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAAEC1360BB3800ED0614 /* RKReachabilityExample.h */,
|
||||
258BAAED1360BB3800ED0614 /* RKReachabilityExample.m */,
|
||||
258BAAEE1360BB3800ED0614 /* RKReachabilityExample.xib */,
|
||||
);
|
||||
path = RKReachabilityExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAAF11360C0FE00ED0614 /* RKBackgroundRequestExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
258BAAF21360C15900ED0614 /* RKBackgroundRequestExample.h */,
|
||||
258BAAF31360C15900ED0614 /* RKBackgroundRequestExample.m */,
|
||||
258BAAF41360C15900ED0614 /* RKBackgroundRequestExample.xib */,
|
||||
);
|
||||
path = RKBackgroundRequestExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2501DE5713607B67003DE9E4 /* RKCatalog */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2501DE7E13607B67003DE9E4 /* Build configuration list for PBXNativeTarget "RKCatalog" */;
|
||||
buildPhases = (
|
||||
2501DE5413607B67003DE9E4 /* Sources */,
|
||||
2501DE5513607B67003DE9E4 /* Frameworks */,
|
||||
2501DE5613607B67003DE9E4 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
2501DEBA13607BD5003DE9E4 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RKCatalog;
|
||||
productName = RKCatalog;
|
||||
productReference = 2501DE5813607B67003DE9E4 /* RKCatalog.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
2501DE4F13607B67003DE9E4 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
ORGANIZATIONNAME = "Two Toasters";
|
||||
};
|
||||
buildConfigurationList = 2501DE5213607B67003DE9E4 /* Build configuration list for PBXProject "RKCatalog" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 2501DE4D13607B67003DE9E4;
|
||||
productRefGroup = 2501DE5913607B67003DE9E4 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 2501DE8213607B74003DE9E4 /* Products */;
|
||||
ProjectRef = 2501DE8113607B74003DE9E4 /* RestKit.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2501DE5713607B67003DE9E4 /* RKCatalog */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
2501DEA113607B74003DE9E4 /* libRestKitNetwork.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitNetwork.a;
|
||||
remoteRef = 2501DEA013607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEA313607B74003DE9E4 /* libRestKitObjectMapping.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitObjectMapping.a;
|
||||
remoteRef = 2501DEA213607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEA513607B74003DE9E4 /* libRestKitSupport.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitSupport.a;
|
||||
remoteRef = 2501DEA413607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEA713607B74003DE9E4 /* libRestKitJSONParserYAJL.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitJSONParserYAJL.a;
|
||||
remoteRef = 2501DEA613607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEA913607B74003DE9E4 /* libRestKitJSONParserSBJSON.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitJSONParserSBJSON.a;
|
||||
remoteRef = 2501DEA813607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEAB13607B74003DE9E4 /* libRestKitJSONParserJSONKit.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitJSONParserJSONKit.a;
|
||||
remoteRef = 2501DEAA13607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEAD13607B74003DE9E4 /* libRestKitXMLParserLibxml.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitXMLParserLibxml.a;
|
||||
remoteRef = 2501DEAC13607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEAF13607B74003DE9E4 /* libRestKitCoreData.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitCoreData.a;
|
||||
remoteRef = 2501DEAE13607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEB113607B74003DE9E4 /* libRestKitThree20.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRestKitThree20.a;
|
||||
remoteRef = 2501DEB013607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2501DEB313607B74003DE9E4 /* UISpec.app */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.application;
|
||||
path = UISpec.app;
|
||||
remoteRef = 2501DEB213607B74003DE9E4 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
2501DE5613607B67003DE9E4 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
258BAA4813608BDB00ED0614 /* InfoPlist.strings in Resources */,
|
||||
258BAA4913608BDB00ED0614 /* MainWindow.xib in Resources */,
|
||||
258BAA4A13608BDB00ED0614 /* RootViewController.xib in Resources */,
|
||||
258BAA4F13608BDB00ED0614 /* RestKit.png in Resources */,
|
||||
258BAA5113608BDB00ED0614 /* RKParamsExample.xib in Resources */,
|
||||
258BAA6B1360AF8200ED0614 /* RKRequestQueueExample.xib in Resources */,
|
||||
258BAAF01360BB3800ED0614 /* RKReachabilityExample.xib in Resources */,
|
||||
258BAAF61360C15900ED0614 /* RKBackgroundRequestExample.xib in Resources */,
|
||||
256F388D1361053900CE0C58 /* RKKeyValueMappingExample.xib in Resources */,
|
||||
256F38981361188700CE0C58 /* RKRelationshipMappingExample.xib in Resources */,
|
||||
256F38AF13612E9400CE0C58 /* RKCoreDataExample.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2501DE5413607B67003DE9E4 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
258BAA4B13608BDB00ED0614 /* main.m in Sources */,
|
||||
258BAA4D13608BDB00ED0614 /* RKCatalogAppDelegate.m in Sources */,
|
||||
258BAA4E13608BDB00ED0614 /* RootViewController.m in Sources */,
|
||||
258BAA5013608BDB00ED0614 /* RKParamsExample.m in Sources */,
|
||||
258BAA6A1360AF8200ED0614 /* RKRequestQueueExample.m in Sources */,
|
||||
258BAAEF1360BB3800ED0614 /* RKReachabilityExample.m in Sources */,
|
||||
258BAAF51360C15900ED0614 /* RKBackgroundRequestExample.m in Sources */,
|
||||
256F388C1361053900CE0C58 /* RKKeyValueMappingExample.m in Sources */,
|
||||
256F38971361188700CE0C58 /* RKRelationshipMappingExample.m in Sources */,
|
||||
256F389B13611B5E00CE0C58 /* User.m in Sources */,
|
||||
256F389E13611B6700CE0C58 /* Task.m in Sources */,
|
||||
256F38A113611B7200CE0C58 /* Project.m in Sources */,
|
||||
256F38AE13612E9400CE0C58 /* RKCoreDataExample.m in Sources */,
|
||||
258E219C1361BC42000D4DCF /* RKCoreDataExample.xcdatamodeld in Sources */,
|
||||
25825DF31361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodeld in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
2501DEBA13607BD5003DE9E4 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = RestKit;
|
||||
targetProxy = 2501DEB913607BD5003DE9E4 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
258BAA3513608BDB00ED0614 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
258BAA3613608BDB00ED0614 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAA3713608BDB00ED0614 /* MainWindow.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
258BAA3813608BDB00ED0614 /* en */,
|
||||
);
|
||||
name = MainWindow.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
258BAA3913608BDB00ED0614 /* RootViewController.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
258BAA3A13608BDB00ED0614 /* en */,
|
||||
);
|
||||
name = RootViewController.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2501DE7C13607B67003DE9E4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvmgcc42;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../Build";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
"-all_load",
|
||||
);
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2501DE7D13607B67003DE9E4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvmgcc42;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../Build";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
"-all_load",
|
||||
);
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2501DE7F13607B67003DE9E4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "App/RKCatalog-Prefix.pch";
|
||||
INFOPLIST_FILE = "App/RKCatalog-Info.plist";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SOURCE_ROOT)/../../Build/$(BUILD_STYLE)-$(PLATFORM_NAME)\"",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2501DE8013607B67003DE9E4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "App/RKCatalog-Prefix.pch";
|
||||
INFOPLIST_FILE = "App/RKCatalog-Info.plist";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SOURCE_ROOT)/../../Build/$(BUILD_STYLE)-$(PLATFORM_NAME)\"",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2501DE5213607B67003DE9E4 /* Build configuration list for PBXProject "RKCatalog" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2501DE7C13607B67003DE9E4 /* Debug */,
|
||||
2501DE7D13607B67003DE9E4 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2501DE7E13607B67003DE9E4 /* Build configuration list for PBXNativeTarget "RKCatalog" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2501DE7F13607B67003DE9E4 /* Debug */,
|
||||
2501DE8013607B67003DE9E4 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
25825DF11361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
25825DF21361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodel */,
|
||||
);
|
||||
currentVersion = 25825DF21361BCA6001A2902 /* RKRelationshipMappingExample.xcdatamodel */;
|
||||
path = RKRelationshipMappingExample.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
258E219A1361BC42000D4DCF /* RKCoreDataExample.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
258E219B1361BC42000D4DCF /* RKCoreDataExample.xcdatamodel */,
|
||||
);
|
||||
currentVersion = 258E219B1361BC42000D4DCF /* RKCoreDataExample.xcdatamodel */;
|
||||
path = RKCoreDataExample.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = 2501DE4F13607B67003DE9E4 /* Project object */;
|
||||
}
|
||||
100
Examples/RKCatalog/Server/server.rb
Normal file
100
Examples/RKCatalog/Server/server.rb
Normal file
@@ -0,0 +1,100 @@
|
||||
# RestKit RKCatalog Sample
|
||||
|
||||
require 'rubygems'
|
||||
require 'sinatra/base'
|
||||
require 'json'
|
||||
|
||||
class RKExampleServer < Sinatra::Base
|
||||
self.app_file = __FILE__
|
||||
|
||||
configure do
|
||||
set :logging, true
|
||||
set :dump_errors, true
|
||||
set :show_exceptions, true
|
||||
end
|
||||
|
||||
post '/RKParamsExample' do
|
||||
"OK"
|
||||
end
|
||||
|
||||
get '/RKRequestQueueExample' do
|
||||
sleep(1.0)
|
||||
"OK"
|
||||
end
|
||||
|
||||
get '/RKBackgroundRequestExample' do
|
||||
content_type 'text/plain'
|
||||
sleep(5)
|
||||
"OK"
|
||||
end
|
||||
|
||||
get '/RKKeyValueMappingExample' do
|
||||
content_type 'application/json'
|
||||
%Q{{
|
||||
"id": 1234,
|
||||
"name": "Personal Checking",
|
||||
"balance": 5013.26,
|
||||
"transactions": [
|
||||
{"id": 1, "payee": "Joe Blow", "amount": 50.16},
|
||||
{"id": 2, "payee": "Grocery Store", "amount": 200.15},
|
||||
{"id": 3, "payee": "John Doe", "amount": 325.00},
|
||||
{"id": 4, "payee": "Grocery Store", "amount": 25.15}]
|
||||
}}
|
||||
end
|
||||
|
||||
# Used by the Relationship mapping examples
|
||||
get '/RKRelationshipMappingExample' do
|
||||
content_type 'application/json'
|
||||
%Q{
|
||||
[{"project": {
|
||||
"id": 123,
|
||||
"name": "Produce RestKit Sample Code",
|
||||
"description": "We need more sample code!",
|
||||
"user": {
|
||||
"id": 1,
|
||||
"name": "Blake Watters",
|
||||
"email": "blake@twotoasters.com"
|
||||
},
|
||||
"tasks": [
|
||||
{"id": 1, "name": "Identify samples to write", "assigned_user_id": 1},
|
||||
{"id": 2, "name": "Write the code", "assigned_user_id": 1},
|
||||
{"id": 3, "name": "Push to Github", "assigned_user_id": 1},
|
||||
{"id": 4, "name": "Update the mailing list", "assigned_user_id": 1}
|
||||
]
|
||||
}},
|
||||
{"project": {
|
||||
"id": 456,
|
||||
"name": "Document Object Mapper",
|
||||
"description": "The object mapper could really use some docs!",
|
||||
"user": {
|
||||
"id": 2,
|
||||
"name": "Jeremy Ellison",
|
||||
"email": "jeremy@twotoasters.com"
|
||||
},
|
||||
"tasks": [
|
||||
{"id": 5, "name": "Mark up methods with Doxygen markup", "assigned_user_id": 2},
|
||||
{"id": 6, "name": "Generate docs and review formatting", "assigned_user_id": 2},
|
||||
{"id": 7, "name": "Review docs for accuracy and completeness", "assigned_user_id": 1},
|
||||
{"id": 8, "name": "Publish to Github", "assigned_user_id": 2}
|
||||
]
|
||||
}},
|
||||
{"project": {
|
||||
"id": 789,
|
||||
"name": "Wash the Cat",
|
||||
"description": "Mr. Fluffy is looking like Mr. Scruffy! Time for a bath!",
|
||||
"user": {
|
||||
"id": 3,
|
||||
"name": "Rachit Shukla",
|
||||
"email": "rachit@twotoasters.com"
|
||||
},
|
||||
"tasks": [
|
||||
{"id": 9, "name": "Place cat in bathtub", "assigned_user_id": 3},
|
||||
{"id": 10, "name": "Run water", "assigned_user_id": 3},
|
||||
{"id": 11, "name": "Try not to get scratched", "assigned_user_id": 3}
|
||||
]
|
||||
}}]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
RKExampleServer.run!
|
||||
Reference in New Issue
Block a user