Skip to content

Commit

Permalink
Migrate table controller codebase into standalone project
Browse files Browse the repository at this point in the history
  • Loading branch information
blakewatters committed Aug 28, 2012
1 parent 806aaea commit c69f011
Show file tree
Hide file tree
Showing 49 changed files with 0 additions and 5,894 deletions.
26 changes: 0 additions & 26 deletions Code/Support/NSBundle+RKAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,12 @@

#import <Foundation/Foundation.h>

#if TARGET_OS_IPHONE
#import <UIKit/UIImage.h>
#endif

/**
Provides convenience methods for accessing data in resources
within an NSBundle.
*/
@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.
Expand Down Expand Up @@ -69,17 +54,6 @@
*/
- (NSString *)stringWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension encoding:(NSStringEncoding)encoding;

#if TARGET_OS_IPHONE
/**
Creates and returns an image object by loading the image data from the resource identified by the specified name and file extension.
@param name The name of the resource file.
@param extension If extension is an empty string or nil, the extension is assumed not to exist and the file is the first file encountered that exactly matches name.
@return A new image object for the specified file, or nil if the method could not initialize the image from the specified file.
*/
- (UIImage *)imageWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension;
#endif

/**
Creates and returns an object representation of the data from the resource identified by the specified name and file extension by reading the
data as a string and parsing it using a parser appropriate for the MIME Type of the file.
Expand Down
29 changes: 0 additions & 29 deletions Code/Support/NSBundle+RKAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,12 @@

#import "NSBundle+RKAdditions.h"
#import "NSString+RKAdditions.h"
#import "UIImage+RKAdditions.h"
#import "RKLog.h"
#import "RKParser.h"
#import "RKParserRegistry.h"

@implementation NSBundle (RKAdditions)

+ (NSBundle *)restKitResourcesBundle
{
static BOOL searchedForBundle = NO;

if (! searchedForBundle) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"RestKitResources" ofType:@"bundle"];
searchedForBundle = YES;
NSBundle *resourcesBundle = [NSBundle bundleWithPath:path];
if (! resourcesBundle) RKLogWarning(@"Unable to find RestKitResources.bundle in your project. Did you forget to add it?");
return resourcesBundle;
}

return [NSBundle bundleWithIdentifier:@"org.restkit.RestKitResources"];
}

- (NSString *)MIMETypeForResource:(NSString *)name withExtension:(NSString *)extension
{
NSString *resourcePath = [self pathForResource:name ofType:extension];
Expand Down Expand Up @@ -80,19 +64,6 @@ - (NSString *)stringWithContentsOfResource:(NSString *)name withExtension:(NSStr
return fixtureData;
}

#if TARGET_OS_IPHONE
- (UIImage *)imageWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension
{
NSString *resourcePath = [self pathForResource:name ofType:extension];
if (! resourcePath) {
RKLogWarning(@"%@ Failed to locate Resource with name '%@' and extension '%@': File Not Found.", self, resourcePath, extension);
return nil;
}

return [UIImage imageWithContentsOfResolutionIndependentFile:resourcePath];
}
#endif

- (id)parsedObjectWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension
{
NSError *error = nil;
Expand Down
Loading

0 comments on commit c69f011

Please sign in to comment.