Added NSBundle helpers to Support.h. Introduced convenience method for retrieving reference to RestKitResources.bundle

This commit is contained in:
Blake Watters
2012-02-24 15:44:18 -05:00
parent 3526dac424
commit 5ae94287e9
29 changed files with 26 additions and 86 deletions

View File

@@ -30,6 +30,17 @@
*/
@interface NSBundle (RKAdditions)
/**
Returns an NSBundle reference to the RestKitResources.bundle file containing
RestKit specific resource assets.
This method is a convenience wrapper for invoking
`[NSBundle bundleWithIdentifier:@"org.restkit.RestKitResources"]`
@return An NSBundle object corresponding to the RestKitResources.bundle file.
*/
+ (NSBundle *)restKitResourcesBundle;
/**
Returns the MIME Type for the resource identified by the specified name and file extension.

View File

@@ -26,6 +26,10 @@
@implementation NSBundle (RKAdditions)
+ (NSBundle *)restKitResourcesBundle {
return [NSBundle bundleWithIdentifier:@"org.restkit.RestKitResources"];
}
- (NSString *)MIMETypeForResource:(NSString *)name withExtension:(NSString *)extension {
NSString *resourcePath = [self pathForResource:name ofType:extension];
if (resourcePath) {

View File

@@ -3,7 +3,7 @@
// RestKit
//
// Created by Blake Watters on 9/30/10.
// Copyright 2010 Two Toasters
// Copyright 2010 RestKit
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -22,10 +22,11 @@
#import "RKErrors.h"
#import "RKMIMETypes.h"
#import "RKLog.h"
#import "RKPathMatcher.h"
#import "RKDotNetDateFormatter.h"
#import "RKDirectory.h"
// Load our categories
#import "NSDictionary+RKAdditions.h"
#import "NSString+RestKit.h"
#import "RKPathMatcher.h"
#import "RKDotNetDateFormatter.h"
#import "RKDirectory.h"
#import "NSBundle+RKAdditions.h"

View File

@@ -1,5 +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/>
<dict>
<key>_XCCurrentVersionName</key>
<string>RestKitCoreData.xcdatamodel</string>
</dict>
</plist>

View File

@@ -2595,7 +2595,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "rsync -av --delete ${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME} ${SOURCE_ROOT}/${FULL_PRODUCT_NAME}";
shellScript = "echo \"rsync -av --delete ${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME} ${SOURCE_ROOT}/${FULL_PRODUCT_NAME}\"";
};
/* End PBXShellScriptBuildPhase section */
@@ -3314,6 +3314,7 @@
25EC1B0A14F8078100C3CF3F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

View File

@@ -1,60 +0,0 @@
<?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>BuildMachineOSBuild</key>
<string>11D50b</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>RestKitResources</string>
<key>CFBundleIdentifier</key>
<string>org.restkit.RestKitResources</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>RestKitResources</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFPlugInDynamicRegisterFunction</key>
<string></string>
<key>CFPlugInDynamicRegistration</key>
<string>NO</string>
<key>CFPlugInFactories</key>
<dict>
<key>00000000-0000-0000-0000-000000000000</key>
<string>MyFactoryFunction</string>
</dict>
<key>CFPlugInTypes</key>
<dict>
<key>00000000-0000-0000-0000-000000000000</key>
<array>
<string>00000000-0000-0000-0000-000000000000</string>
</array>
</dict>
<key>CFPlugInUnloadFunction</key>
<string></string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>4E109</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>11D50a</string>
<key>DTSDKName</key>
<string>macosx10.7</string>
<key>DTXcode</key>
<string>0430</string>
<key>DTXcodeBuild</key>
<string>4E109</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 __MyCompanyName__. All rights reserved.</string>
</dict>
</plist>

View File

@@ -1,20 +0,0 @@
<?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>NSManagedObjectModel_VersionHashes</key>
<dict>
<key>RestKitCoreData</key>
<dict>
<key>RKSearchWord</key>
<data>
8ILMzYCnYe8uGzdLHqnxo6RUX+ifEi9tjcRr4dRZL24=
</data>
<key>RKSearchableManagedObject</key>
<data>
mkPRCudukXRO5vBX5pUU6ldJVkhf7bE7wkbmDOlxJDo=
</data>
</dict>
</dict>
</dict>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB