mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-03 22:49:50 +08:00
* 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
38 lines
901 B
Objective-C
38 lines
901 B
Objective-C
//
|
|
// RKURL.m
|
|
// RestKit
|
|
//
|
|
// Created by Jeff Arena on 10/18/10.
|
|
// Copyright 2010 Two Toasters. All rights reserved.
|
|
//
|
|
|
|
#import "RKURL.h"
|
|
|
|
@implementation RKURL
|
|
|
|
@synthesize baseURLString = _baseURLString;
|
|
@synthesize resourcePath = _resourcePath;
|
|
|
|
+ (RKURL*)URLWithBaseURLString:(NSString*)baseURLString resourcePath:(NSString*)resourcePath {
|
|
return [[[RKURL alloc] initWithBaseURLString:baseURLString resourcePath:resourcePath] autorelease];
|
|
}
|
|
|
|
- (id)initWithBaseURLString:(NSString*)baseURLString resourcePath:(NSString*)resourcePath {
|
|
self = [self initWithString:[NSString stringWithFormat:@"%@%@", baseURLString, resourcePath]];
|
|
if (self) {
|
|
_baseURLString = [baseURLString copy];
|
|
_resourcePath = [resourcePath copy];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[_baseURLString release];
|
|
_baseURLString = nil;
|
|
[_resourcePath release];
|
|
_resourcePath = nil;
|
|
[super dealloc];
|
|
}
|
|
|
|
@end
|