Permalink
Browse files

Finished cleanup of HTTP AUTH and XML Support. Ready to tag 0.9.1

  • Loading branch information...
1 parent aea1df2 commit c90ec2770d740d8c69a63d990c49bc548aeb60a5 @blakewatters blakewatters committed Mar 29, 2011
View
7 Code/Network/RKClient.m
@@ -6,10 +6,11 @@
// Copyright 2009 Two Toasters. All rights reserved.
//
+#import <SystemConfiguration/SCNetworkReachability.h>
#import "RKClient.h"
#import "RKObjectLoader.h"
#import "RKURL.h"
-#import <SystemConfiguration/SCNetworkReachability.h>
+#import "RKNotifications.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
// Global
@@ -104,7 +105,8 @@ + (RKClient*)clientWithBaseURL:(NSString*)baseURL username:(NSString*)username p
}
- (id)init {
- if (self = [super init]) {
+ self = [super init];
+ if (self) {
_HTTPHeaders = [[NSMutableDictionary alloc] init];
self.serviceUnavailableAlertEnabled = NO;
self.serviceUnavailableAlertTitle = NSLocalizedString(@"Service Unavailable", nil);
@@ -121,6 +123,7 @@ - (void)dealloc {
self.serviceUnavailableAlertTitle = nil;
self.serviceUnavailableAlertMessage = nil;
[_HTTPHeaders release];
+
[super dealloc];
}
View
20 Code/Network/RKNetwork.h
@@ -0,0 +1,20 @@
+//
+// RKNetwork.h
+// RestKit
+//
+// Created by Blake Watters on 3/28/11.
+// Copyright 2011 Two Toasters. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+/**
+ * Returns the global value for credential persistence to use during HTTP AUTH
+ * Defaults to NSURLCredentialPersistenceForSession
+ */
+NSURLCredentialPersistence RKNetworkGetGlobalCredentialPersistence();
+
+/**
+ * Set the global value for credential persistence to use during HTTP AUTH
+ */
+void RKNetworkSetGlobalCredentialPersistence(NSURLCredentialPersistence persistence);
View
20 Code/Network/RKNetwork.m
@@ -0,0 +1,20 @@
+//
+// MyClass.m
+// RestKit
+//
+// Created by Blake Watters on 3/28/11.
+// Copyright 2011 Two Toasters. All rights reserved.
+//
+
+#import "RKNetwork.h"
+
+// Global credential persistence value.
+static NSURLCredentialPersistence gCredentialPersistence = NSURLCredentialPersistenceForSession;
+
+NSURLCredentialPersistence RKNetworkGetGlobalCredentialPersistence() {
+ return gCredentialPersistence;
+}
+
+void RKNetworkSetGlobalCredentialPersistence(NSURLCredentialPersistence persistence) {
+ gCredentialPersistence = persistence;
+}
View
7 Code/Network/RKNotifications.h
@@ -16,6 +16,7 @@
* This is useful for doing things like generating automatic logging
* for all your requests or sending the response times
*/
-extern NSString* const kRKRequestSentNotification;
-extern NSString* const kRKResponseReceivedNotification;
-extern NSString* const kRKRequestFailedWithErrorNotification;
+extern NSString* const RKRequestSentNotification;
+extern NSString* const RKRequestDidLoadResponseNotification;
+extern NSString* const RKResponseReceivedNotification;
+extern NSString* const RKRequestFailedWithErrorNotification;
View
7 Code/Network/RKNotifications.m
@@ -8,6 +8,7 @@
#import "RKNotifications.h"
-NSString* const kRKRequestSentNotification = @"kRKRequestSentNotification";
-NSString* const kRKResponseReceivedNotification = @"kRKRespongReceivedNotification";
-NSString* const kRKRequestFailedWithErrorNotification = @"kRKRequestFailedWithErrorNotification";
+NSString* const RKRequestSentNotification = @"RKRequestSentNotification";
+NSString* const RKRequestDidLoadResponseNotification = @"RKRequestDidLoadResponseNotification";
+NSString* const RKRequestFailedWithErrorNotification = @"RKRequestFailedWithErrorNotification";
+NSString* const RKResponseReceivedNotification = @"RKRespongReceivedNotification";
View
2 Code/Network/RKRequest.h
@@ -32,7 +32,6 @@ typedef enum RKRequestMethod {
NSObject<RKRequestSerializable>* _params;
NSObject<RKRequestDelegate>* _delegate;
id _userData;
- NSString* _authenticationScheme;
NSString* _username;
NSString* _password;
RKRequestMethod _method;
@@ -86,7 +85,6 @@ typedef enum RKRequestMethod {
// The authentication scheme to use. When set to kCFHTTPAuthenticationSchemeBasic, authentication will
// be setup before a challenge occurs
-@property(nonatomic, retain) NSString* authenticationScheme;
@property(nonatomic, retain) NSString* username;
@property(nonatomic, retain) NSString* password;
View
30 Code/Network/RKRequest.m
@@ -19,8 +19,7 @@
@implementation RKRequest
@synthesize URL = _URL, URLRequest = _URLRequest, delegate = _delegate, additionalHTTPHeaders = _additionalHTTPHeaders,
- params = _params, userData = _userData, username = _username, password = _password, method = _method,
- authenticationScheme = _authenticationScheme;
+ params = _params, userData = _userData, username = _username, password = _password, method = _method;
+ (RKRequest*)requestWithURL:(NSURL*)URL delegate:(id)delegate {
return [[[RKRequest alloc] initWithURL:URL delegate:delegate] autorelease];
@@ -61,7 +60,6 @@ - (void)dealloc {
_params = nil;
[_additionalHTTPHeaders release];
_additionalHTTPHeaders = nil;
- [_authenticationScheme release];
[_username release];
_username = nil;
[_password release];
@@ -97,20 +95,6 @@ - (void)addHeadersToRequest {
[_URLRequest setValue:[NSString stringWithFormat:@"%d", [_params HTTPHeaderValueForContentLength]] forHTTPHeaderField:@"Content-Length"];
}
}
-
- if (_username != nil && [_authenticationScheme isEqualToString:(NSString*)kCFHTTPAuthenticationSchemeBasic]) {
- // Add authentication headers so we don't have to deal with an extra cycle for each message requiring basic auth.
- CFHTTPMessageRef dummyRequest = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)[self HTTPMethod], (CFURLRef)[self URL], kCFHTTPVersion1_1);
- CFHTTPMessageAddAuthentication(dummyRequest, nil, (CFStringRef)_username, (CFStringRef)_password, kCFHTTPAuthenticationSchemeBasic, FALSE);
- CFStringRef authorizationString = CFHTTPMessageCopyHeaderFieldValue(dummyRequest, CFSTR("Authorization"));
-
- [_URLRequest setValue:(NSString *)authorizationString forHTTPHeaderField:@"Authorization"];
-
- CFRelease(dummyRequest);
- CFRelease(authorizationString);
- }
-
- NSLog(@"Headers: %@", [_URLRequest allHTTPHeaderFields]);
}
// Setup the NSURLRequest. The request must be prepared right before dispatching
@@ -152,7 +136,7 @@ - (void)fireAsynchronousRequest {
[body release];
NSDate* sentAt = [NSDate date];
NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[self HTTPMethod], @"HTTPMethod", [self URL], @"URL", sentAt, @"sentAt", nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:kRKRequestSentNotification object:self userInfo:userInfo];
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKRequestSentNotification object:self userInfo:userInfo];
_isLoading = YES;
RKResponse* response = [[[RKResponse alloc] initWithRequest:self] autorelease];
@@ -180,7 +164,7 @@ - (RKResponse*)sendSynchronously {
[body release];
NSDate* sentAt = [NSDate date];
NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[self HTTPMethod], @"HTTPMethod", [self URL], @"URL", sentAt, @"sentAt", nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:kRKRequestSentNotification object:self userInfo:userInfo];
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKRequestSentNotification object:self userInfo:userInfo];
_isLoading = YES;
payload = [NSURLConnection sendSynchronousRequest:_URLRequest returningResponse:&URLResponse error:&error];
@@ -223,7 +207,7 @@ - (void)didFailLoadWithError:(NSError*)error {
NSDate* receivedAt = [NSDate date];
NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[self HTTPMethod], @"HTTPMethod",
[self URL], @"URL", receivedAt, @"receivedAt", error, @"error", nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:kRKRequestFailedWithErrorNotification object:self userInfo:userInfo];
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKRequestFailedWithErrorNotification object:self userInfo:userInfo];
}
- (void)didFinishLoad:(RKResponse*)response {
@@ -234,9 +218,9 @@ - (void)didFinishLoad:(RKResponse*)response {
[_delegate request:self didLoadResponse:response];
}
- NSDate* receivedAt = [NSDate date];
- NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[self HTTPMethod], @"HTTPMethod", [self URL], @"URL", receivedAt, @"receivedAt", nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:kRKResponseReceivedNotification object:response userInfo:userInfo];
+ NSDictionary* userInfo = [NSDictionary dictionaryWithObject:response forKey:@"response"];
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKRequestDidLoadResponseNotification object:self userInfo:userInfo];
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKResponseReceivedNotification object:response userInfo:nil];
if ([response isServiceUnavailable] && [[RKClient sharedClient] serviceUnavailableAlertEnabled]) {
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:[[RKClient sharedClient] serviceUnavailableAlertTitle]
View
4 Code/Network/RKRequestQueue.m
@@ -42,11 +42,11 @@ - (id)init {
_totalLoading = 0;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(responseDidLoad:)
- name:kRKResponseReceivedNotification
+ name:RKResponseReceivedNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(responseDidLoad:)
- name:kRKRequestFailedWithErrorNotification
+ name:RKRequestFailedWithErrorNotification
object:nil];
}
return self;
View
7 Code/Network/RKResponse.m
@@ -9,6 +9,7 @@
#import "RKResponse.h"
#import "RKNotifications.h"
#import "RKJSONParser.h"
+#import "RKNetwork.h"
@implementation RKResponse
@@ -62,9 +63,9 @@ - (void)dealloc {
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
if ([challenge previousFailureCount] == 0) {
NSURLCredential *newCredential;
- newCredential=[NSURLCredential credentialWithUser:[NSString stringWithFormat:@"%@", _request.username]
- password:[NSString stringWithFormat:@"%@", _request.password]
- persistence:NSURLCredentialPersistenceNone];
+ newCredential = [NSURLCredential credentialWithUser:[NSString stringWithFormat:@"%@", _request.username]
+ password:[NSString stringWithFormat:@"%@", _request.password]
+ persistence:RKNetworkGetGlobalCredentialPersistence()];
[[challenge sender] useCredential:newCredential
forAuthenticationChallenge:challenge];
} else {
View
4 Code/ObjectMapping/RKObjectLoader.m
@@ -75,7 +75,7 @@ - (void)responseProcessingSuccessful:(BOOL)successful withError:(NSError*)error
[self URL], @"URL",
receivedAt, @"receivedAt",
nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:kRKResponseReceivedNotification
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKResponseReceivedNotification
object:_response
userInfo:userInfo];
} else {
@@ -84,7 +84,7 @@ - (void)responseProcessingSuccessful:(BOOL)successful withError:(NSError*)error
receivedAt, @"receivedAt",
error, @"error",
nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:kRKRequestFailedWithErrorNotification
+ [[NSNotificationCenter defaultCenter] postNotificationName:RKRequestFailedWithErrorNotification
object:self
userInfo:userInfo];
}
View
30 Code/ObjectMapping/RKObjectMapper.m
@@ -21,8 +21,6 @@
// TODO: Rails specifics should probably move elsewhere...
static const NSString* kRKModelMapperRailsDateTimeFormatString = @"yyyy-MM-dd'T'HH:mm:ss'Z'"; // 2009-08-08T17:23:59Z
static const NSString* kRKModelMapperRailsDateFormatString = @"MM/dd/yyyy";
-static const NSString* kRKModelMapperJSONMappingFormatParserKey = @"RKJSONMappingFormatParser";
-static const NSString* kRKModelMapperXMLMappingFormatParserKey = @"RKXMLMappingFormatParser";
@interface RKObjectMapper (Private)
@@ -93,34 +91,32 @@ - (void)setFormat:(RKMappingFormat)format {
// Mapping from a string
- (id)parseString:(NSString*)string {
- NSMutableDictionary* threadDictionary = [[NSThread currentThread] threadDictionary];
-
Class parserClass;
- const NSString* parserKey;
+ NSString* className = nil;
NSObject<RKParser>* parser = nil;
if (_format == RKMappingFormatJSON) {
- parserClass = [RKJSONParser class];
- parserKey = kRKModelMapperJSONMappingFormatParserKey;
- } else {
- parserClass = [RKXMLParser class];
- parserKey = kRKModelMapperXMLMappingFormatParserKey;
+ className = @"RKJSONParser";
+ } else if (_format == RKMappingFormatXML) {
+ className = @"RKXMLParser";
+ }
+
+ parserClass = NSClassFromString(className);
+ if (nil == parserClass) {
+ [NSException raise:@"Unable to find an appropriate parser."
+ format:@"The object mapper attempted to process a payload via the '%@' parser, but it was not found.", className];
}
- parser = [threadDictionary objectForKey:parserKey];
-
- if (!parser) {
- parser = [[parserClass alloc] init];
- [threadDictionary setObject:parser forKey:parserKey];
- [parser release];
- }
+ parser = [[parserClass alloc] init];
id result = nil;
@try {
result = [parser objectFromString:string];
}
@catch (NSException* e) {
NSLog(@"[RestKit] RKObjectMapper:parseString: Exception (%@) parsing error from string: %@", [e reason], string);
}
+ [parser release];
+
return result;
}
View
6 Examples/RKTwitter/Classes/RKTwitterViewController.m
@@ -60,8 +60,12 @@ - (void)dealloc {
#pragma mark RKObjectLoaderDelegate methods
+- (void)request:(RKRequest*)request didLoadResponse:(RKResponse*)response {
+ NSLog(@"Loaded payload: %@", [response bodyAsString]);
+}
+
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects {
- NSLog(@"Loaded statuses: %@", objects);
+ NSLog(@"Loaded statuses: %@", objects);
[_statuses release];
_statuses = [objects retain];
[_tableView reloadData];
View
29 Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ 251E0D31134187F80017A6DA /* libRestKitXMLParserLibxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 251E0D30134187F80017A6DA /* libRestKitXMLParserLibxml.a */; };
2538E811123419CA00ACB5D7 /* RKTUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 2538E810123419CA00ACB5D7 /* RKTUser.m */; };
2538E814123419EC00ACB5D7 /* RKTStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 2538E813123419EC00ACB5D7 /* RKTStatus.m */; };
2538E8671234250100ACB5D7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2538E8661234250100ACB5D7 /* SystemConfiguration.framework */; };
@@ -53,6 +54,13 @@
remoteGlobalIDString = 3F6C39A510FE5C95008F47C5;
remoteInfo = UISpec;
};
+ 25BD44171340331700DBACDD /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 25BD43BD1340315800DBACDD;
+ remoteInfo = "RestKitXMLParser+Libxml";
+ };
3F3CE2C4125B93780083FDCB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */;
@@ -110,6 +118,7 @@
1D3623250D0F684500981E51 /* RKTwitterAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTwitterAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* RKTwitter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKTwitter.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 251E0D30134187F80017A6DA /* libRestKitXMLParserLibxml.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRestKitXMLParserLibxml.a; sourceTree = SOURCE_ROOT; };
2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = SOURCE_ROOT; };
2538E80F123419CA00ACB5D7 /* RKTUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKTUser.h; sourceTree = "<group>"; };
2538E810123419CA00ACB5D7 /* RKTUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTUser.m; sourceTree = "<group>"; };
@@ -139,6 +148,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 251E0D31134187F80017A6DA /* libRestKitXMLParserLibxml.a in Frameworks */,
3F02F592131D683A004E1F54 /* libxml2.dylib in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
@@ -188,6 +198,7 @@
3F3CE2CB125B93780083FDCB /* libRestKitJSONParserYAJL.a */,
3F3CE2CD125B93780083FDCB /* libRestKitJSONParserSBJSON.a */,
25321673133988730099A5DB /* libRestKitJSONParserJSONKit.a */,
+ 25BD44181340331700DBACDD /* libRestKitXMLParserLibxml.a */,
3F3CE2CF125B93780083FDCB /* libRestKitCoreData.a */,
2538E808123417E500ACB5D7 /* libRestKitThree20.a */,
2538E80A123417E500ACB5D7 /* UISpec.app */,
@@ -198,7 +209,6 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
- 3F02F591131D683A004E1F54 /* libxml2.dylib */,
2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
@@ -235,6 +245,8 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 251E0D30134187F80017A6DA /* libRestKitXMLParserLibxml.a */,
+ 3F02F591131D683A004E1F54 /* libxml2.dylib */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
@@ -319,6 +331,13 @@
remoteRef = 2538E809123417E500ACB5D7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
+ 25BD44181340331700DBACDD /* libRestKitXMLParserLibxml.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libRestKitXMLParserLibxml.a;
+ remoteRef = 25BD44171340331700DBACDD /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
3F3CE2C5125B93780083FDCB /* libRestKitNetwork.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@@ -415,6 +434,10 @@
GCC_PREFIX_HEADER = RKTwitter_Prefix.pch;
HEADER_SEARCH_PATHS = ../../Build;
INFOPLIST_FILE = "Resources/RKTwitter-Info.plist";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)\"",
+ );
OTHER_LDFLAGS = (
"-all_load",
"-ObjC",
@@ -433,6 +456,10 @@
GCC_PREFIX_HEADER = RKTwitter_Prefix.pch;
HEADER_SEARCH_PATHS = ../../Build;
INFOPLIST_FILE = "Resources/RKTwitter-Info.plist";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)\"",
+ );
OTHER_LDFLAGS = (
"-all_load",
"-ObjC",
View
27 Examples/RKTwitterCoreData/RKTwitterCoreData.xcodeproj/project.pbxproj
@@ -62,6 +62,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
+ 251E0D52134189230017A6DA /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 25BD43BD1340315800DBACDD;
+ remoteInfo = "RestKitXMLParser+Libxml";
+ };
2538E807123417E500ACB5D7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */;
@@ -145,7 +152,7 @@
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* RKTwitterAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKTwitterAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* RKTwitterAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKTwitterAppDelegate.m; sourceTree = "<group>"; };
- 1D6058910D05DD3D006BFB54 /* RKTwitter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKTwitter.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1D6058910D05DD3D006BFB54 /* RKTwitterCoreData.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKTwitterCoreData.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = SOURCE_ROOT; };
2538E80F123419CA00ACB5D7 /* RKTUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKTUser.h; sourceTree = "<group>"; };
@@ -237,7 +244,7 @@
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
- 1D6058910D05DD3D006BFB54 /* RKTwitter.app */,
+ 1D6058910D05DD3D006BFB54 /* RKTwitterCoreData.app */,
25F2A1961322D59400A33DE4 /* Generate Seed Database.app */,
);
name = Products;
@@ -252,6 +259,7 @@
3F3CE2CB125B93780083FDCB /* libRestKitJSONParserYAJL.a */,
3F3CE2CD125B93780083FDCB /* libRestKitJSONParserSBJSON.a */,
25E5EEB4133BB2D700C33091 /* libRestKitJSONParserJSONKit.a */,
+ 251E0D53134189230017A6DA /* libRestKitXMLParserLibxml.a */,
3F3CE2CF125B93780083FDCB /* libRestKitCoreData.a */,
2538E808123417E500ACB5D7 /* libRestKitThree20.a */,
2538E80A123417E500ACB5D7 /* UISpec.app */,
@@ -262,7 +270,6 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
- 3FB46640131D78A400E37C51 /* libxml2.dylib */,
2538E7FF123417E500ACB5D7 /* RestKit.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
@@ -310,6 +317,7 @@
2538E8661234250100ACB5D7 /* SystemConfiguration.framework */,
8452D3F8128244D90069F4A9 /* CFNetwork.framework */,
8452D3FC128244E60069F4A9 /* MobileCoreServices.framework */,
+ 3FB46640131D78A400E37C51 /* libxml2.dylib */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -332,7 +340,7 @@
);
name = RKTwitter;
productName = RKTwitter;
- productReference = 1D6058910D05DD3D006BFB54 /* RKTwitter.app */;
+ productReference = 1D6058910D05DD3D006BFB54 /* RKTwitterCoreData.app */;
productType = "com.apple.product-type.application";
};
25F2A1751322D59400A33DE4 /* Generate Seed Database */ = {
@@ -385,6 +393,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
+ 251E0D53134189230017A6DA /* libRestKitXMLParserLibxml.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libRestKitXMLParserLibxml.a;
+ remoteRef = 251E0D52134189230017A6DA /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
2538E808123417E500ACB5D7 /* libRestKitThree20.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@@ -541,7 +556,7 @@
"-all_load",
"-ObjC",
);
- PRODUCT_NAME = RKTwitter;
+ PRODUCT_NAME = RKTwitterCoreData;
};
name = Debug;
};
@@ -559,7 +574,7 @@
"-all_load",
"-ObjC",
);
- PRODUCT_NAME = RKTwitter;
+ PRODUCT_NAME = RKTwitterCoreData;
VALIDATE_PRODUCT = YES;
};
name = Release;
View
10 RestKit.xcodeproj/project.pbxproj
@@ -31,6 +31,8 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 250C29FD134185D2000A3551 /* RKNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 250C29FB134185CE000A3551 /* RKNetwork.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 250C29FE134185D2000A3551 /* RKNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 250C29FC134185D0000A3551 /* RKNetwork.m */; };
251D14AC133597B800959061 /* RKManagedObjectLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 251D14AA133597B800959061 /* RKManagedObjectLoader.h */; };
251D14AD133597B800959061 /* RKManagedObjectLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 251D14AB133597B800959061 /* RKManagedObjectLoader.m */; };
2523363E11E7A1F00048F9B4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F6C3A9510FE7524008F47C5 /* UIKit.framework */; };
@@ -309,6 +311,8 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 250C29FB134185CE000A3551 /* RKNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKNetwork.h; sourceTree = "<group>"; };
+ 250C29FC134185D0000A3551 /* RKNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKNetwork.m; sourceTree = "<group>"; };
251D14AA133597B800959061 /* RKManagedObjectLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKManagedObjectLoader.h; sourceTree = "<group>"; };
251D14AB133597B800959061 /* RKManagedObjectLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKManagedObjectLoader.m; sourceTree = "<group>"; };
2523360511E79F090048F9B4 /* libRestKitThree20.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRestKitThree20.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -705,6 +709,8 @@
73FE56C5126CB91600E0F30B /* RKURL.m */,
2538C05A12A6C44A0006903C /* RKRequestQueue.h */,
2538C05B12A6C44A0006903C /* RKRequestQueue.m */,
+ 250C29FB134185CE000A3551 /* RKNetwork.h */,
+ 250C29FC134185D0000A3551 /* RKNetwork.m */,
);
path = Network;
sourceTree = "<group>";
@@ -1076,9 +1082,10 @@
253A08DD125522E100976E89 /* RKRequest.h in Headers */,
253A08DF125522E300976E89 /* RKRequestSerializable.h in Headers */,
253A08E0125522E300976E89 /* RKResponse.h in Headers */,
- 73FE56C7126CB91600E0F30B /* RKURL.h in Headers */,
73C89EF212A5BB9A000FE600 /* RKReachabilityObserver.h in Headers */,
+ 73FE56C7126CB91600E0F30B /* RKURL.h in Headers */,
2538C05C12A6C44A0006903C /* RKRequestQueue.h in Headers */,
+ 250C29FD134185D2000A3551 /* RKNetwork.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1541,6 +1548,7 @@
73FE56C8126CB91600E0F30B /* RKURL.m in Sources */,
73C89EF312A5BB9A000FE600 /* RKReachabilityObserver.m in Sources */,
2538C05D12A6C44A0006903C /* RKRequestQueue.m in Sources */,
+ 250C29FE134185D2000A3551 /* RKNetwork.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
5 Specs/Network/RKAuthenticationSpec.m
@@ -8,6 +8,7 @@
#import "RKSpecEnvironment.h"
#import "RKClient.h"
+#import "RKNetwork.h"
static NSString* const RKAuthenticationSpecUsername = @"restkit";
static NSString* const RKAuthenticationSpecPassword = @"authentication";
@@ -20,6 +21,10 @@ @interface RKAuthenticationSpec : NSObject <UISpec> {
@implementation RKAuthenticationSpec
+- (void)beforeAll {
+ RKNetworkSetGlobalCredentialPersistence(NSURLCredentialPersistenceNone);
+}
+
- (void)itShouldAccessUnprotectedResourcePaths {
RKSpecResponseLoader* loader = [RKSpecResponseLoader responseLoader];
RKClient* client = [RKClient clientWithBaseURL:RKSpecGetBaseURL()];
View
2 Specs/ObjectMapping/RKDynamicRouterSpec.m
@@ -18,7 +18,7 @@ @interface RKDynamicRouterSpec : NSObject <UISpec> {
@implementation RKDynamicRouterSpec
- (void)beforeAll {
- RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:3001"];
+ RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:4567"];
objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"RestKitSpecs.sqlite"];
}
View
2 Specs/ObjectMapping/RKRailsRouterSpec.m
@@ -20,7 +20,7 @@ @interface RKRailsRouterSpec : NSObject <UISpec> {
@implementation RKRailsRouterSpec
- (void)beforeAll {
- RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:3001"];
+ RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:4567"];
objectManager.objectStore = [[RKManagedObjectStore alloc] initWithStoreFilename:@"RestKitSpecs.sqlite"];
}

0 comments on commit c90ec27

Please sign in to comment.