mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-14 12:13:00 +08:00
Added NSBundle helpers to Support.h. Introduced convenience method for retrieving reference to RestKitResources.bundle
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user