mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 12:27:52 +08:00
More Xcode 4 crap
This commit is contained in:
@@ -41,7 +41,7 @@ NSString* const kRKStringBoundary = @"0xKhTmLbOuNdArY";
|
||||
}
|
||||
|
||||
- (RKParams*)initWithDictionary:(NSDictionary*)dictionary {
|
||||
if (self = [self init]) {
|
||||
if ((self = [self init])) {
|
||||
for (NSString* key in dictionary) {
|
||||
id value = [dictionary objectForKey:key];
|
||||
[self setValue:value forParam:key];
|
||||
|
||||
@@ -23,7 +23,7 @@ extern NSString* const kRKStringBoundary;
|
||||
@synthesize fileName = _fileName, MIMEType = _MIMEType, name = _name;
|
||||
|
||||
- (id)initWithName:(NSString*)name {
|
||||
if (self = [self init]) {
|
||||
if ((self = [self init])) {
|
||||
_name = [name retain];
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ extern NSString* const kRKStringBoundary;
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString*)name value:(id<NSObject>)value {
|
||||
if (self = [self initWithName:name]) {
|
||||
if ((self = [self initWithName:name])) {
|
||||
NSMutableData* body = [NSMutableData data];
|
||||
if ([value respondsToSelector:@selector(dataUsingEncoding:)]) {
|
||||
[body appendData:[(NSString*)value dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
@@ -47,7 +47,7 @@ extern NSString* const kRKStringBoundary;
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString*)name data:(NSData*)data {
|
||||
if (self = [self initWithName:name]) {
|
||||
if ((self = [self initWithName:name])) {
|
||||
_bodyStream = [[NSInputStream inputStreamWithData:data] retain];
|
||||
_bodyLength = [data length];
|
||||
}
|
||||
@@ -56,7 +56,7 @@ extern NSString* const kRKStringBoundary;
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString*)name file:(NSString*)filePath {
|
||||
if (self = [self initWithName:name]) {
|
||||
if ((self = [self initWithName:name])) {
|
||||
NSAssert1([[NSFileManager defaultManager] fileExistsAtPath:filePath], @"Expected file to exist at path: %@", filePath);
|
||||
_fileName = [[filePath lastPathComponent] retain];
|
||||
_MIMEType = [[self mimeTypeForExtension:[filePath pathExtension]] retain];
|
||||
|
||||
@@ -36,7 +36,7 @@ static const NSInteger kMaxConcurrentLoads = 5;
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
if ((self = [super init])) {
|
||||
_requests = [[NSMutableArray alloc] init];
|
||||
_suspended = NO;
|
||||
_totalLoading = 0;
|
||||
|
||||
Reference in New Issue
Block a user