Merge branch 'master' of git://github.com/twotoasters/RestKit

This commit is contained in:
Jeff Arena
2010-10-28 15:00:53 -07:00
6 changed files with 26 additions and 3 deletions

View File

@@ -52,10 +52,16 @@
- (RKParamsAttachment*)setFile:(NSString*)filePath forParam:(NSString*)param;
/**
* Sets the value to the data object for a named parameter
* Sets the value to the data object for a named parameter. A default MIME type of
* application/octet-stream will be used.
*/
- (RKParamsAttachment*)setData:(NSData*)data forParam:(NSString*)param;
/**
* Sets the value for a named parameter to an NSData object with a specific MIME type
*/
- (RKParamsAttachment*)setData:(NSData*)data MIMEType:(NSString*)MIMEType forParam:(NSString*)param;
/**
* Sets the value for a named parameter to a data object with the specified MIME Type and attachment file name
*

View File

@@ -75,6 +75,15 @@ NSString* const kRKStringBoundary = @"0xKhTmLbOuNdArY";
return attachment;
}
- (RKParamsAttachment*)setData:(NSData*)data MIMEType:(NSString*)MIMEType forParam:(NSString*)param {
RKParamsAttachment* attachment = [self setData:data forParam:param];
if (MIMEType != nil) {
attachment.MIMEType = MIMEType;
}
return attachment;
}
- (RKParamsAttachment*)setData:(NSData*)data MIMEType:(NSString*)MIMEType fileName:(NSString*)fileName forParam:(NSString*)param {
RKParamsAttachment* attachment = [self setData:data forParam:param];
if (MIMEType != nil) {

View File

@@ -106,7 +106,11 @@
[self release];
return YES;
} else if ([response isError]) {
[_delegate objectLoader:self didFailWithError:[_mapper parseErrorFromString:[response bodyAsString]]];
if ([response isJSON]) {
[_delegate objectLoader:self didFailWithError:[_mapper parseErrorFromString:[response bodyAsString]]];
} else {
[_delegate objectLoader:self didFailWithError:[response bodyAsString]];
}
[self release];
return YES;
}

View File

@@ -62,7 +62,7 @@ To add RestKit to your project (you're using git, right?):
1. Look to the bottom of the **General** pane labeled **Linked Libraries**. You will need to add the following frameworks:
* **CFNetwork.framework** - Required for networking support.
* **SystemConfiguration.framework** - Required for detection of network availability.
* **MobileCoreServices.framework** - Optional. Provides support for MIME type auto-detection for uploaded files.
* **MobileCoreServices.framework** - Required. Provides support for MIME type auto-detection for uploaded files.
* **CoreData.framework** - Optional. Required for use of the Core Data backed persistent object store.
1. Get Info on your target and you should be looking at the **General** tag. In the top **Direct Dependencies** section, click the plus button and add a direct dependency on the RestKit target.
1. Switch to the 'Build' tab in your project inspector. Make sure that your **Configuration** pop-up menu reads **All Configurations** so that your changes will work for all build configurations.

View File

@@ -165,6 +165,7 @@
259569D5126DF464004BAC4C /* UISpec_1_0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 250BC51011F62D6B00F3FE5A /* UISpec_1_0.a */; };
25957826126E3BE9004BAC4C /* RKRailsRouterSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 25957825126E3BE9004BAC4C /* RKRailsRouterSpec.m */; };
25A5B4E912762249003DC8A4 /* blake.png in Resources */ = {isa = PBXBuildFile; fileRef = 25A5B4E812762249003DC8A4 /* blake.png */; };
25E0774D1279E64500B22EC9 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25E075981279D9AB00B22EC9 /* MobileCoreServices.framework */; };
3F032A7910FFB89100F35142 /* RKCat.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F032A7810FFB89100F35142 /* RKCat.m */; };
3F032AA810FFBBCD00F35142 /* RKHouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F032AA710FFBBCD00F35142 /* RKHouse.m */; };
3F032AAB10FFBC1F00F35142 /* RKResident.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F032AAA10FFBC1F00F35142 /* RKResident.m */; };
@@ -560,6 +561,7 @@
2595698D126DF283004BAC4C /* UISpec.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = UISpec.xcodeproj; path = Specs/Support/UISpec/xcode/UISpec/UISpec.xcodeproj; sourceTree = SOURCE_ROOT; };
25957825126E3BE9004BAC4C /* RKRailsRouterSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKRailsRouterSpec.m; sourceTree = "<group>"; };
25A5B4E812762249003DC8A4 /* blake.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blake.png; sourceTree = "<group>"; };
25E075981279D9AB00B22EC9 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
3F032A7710FFB89100F35142 /* RKCat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKCat.h; sourceTree = "<group>"; };
3F032A7810FFB89100F35142 /* RKCat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKCat.m; sourceTree = "<group>"; };
3F032AA610FFBBCD00F35142 /* RKHouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKHouse.h; sourceTree = "<group>"; };
@@ -645,6 +647,7 @@
25956986126DF1AE004BAC4C /* libRestKitObjectMapping.a in Frameworks */,
25956987126DF1AE004BAC4C /* libRestKitSupport.a in Frameworks */,
259569D5126DF464004BAC4C /* UISpec_1_0.a in Frameworks */,
25E0774D1279E64500B22EC9 /* MobileCoreServices.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -686,6 +689,7 @@
3F6C3A2D10FE749C008F47C5 /* Foundation.framework */,
AACBBE490F95108600F1A2B1 /* Foundation.framework */,
255DE0E110FFABA500A85891 /* CoreData.framework */,
25E075981279D9AB00B22EC9 /* MobileCoreServices.framework */,
255DE0F310FFAC0A00A85891 /* SystemConfiguration.framework */,
);
name = Frameworks;

Binary file not shown.