Created
December 22, 2010 08:16
-
-
Save ironfounderson/751259 to your computer and use it in GitHub Desktop.
Loading content from a file contained as a bundle resource within a unit test target
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)contentOfXMLFile:(NSString *)filename { | |
NSString *contentPath = [[NSBundle bundleForClass:[self class]] pathForResource:filename | |
ofType:@"xml"]; | |
NSURL *contentURL = [NSURL fileURLWithPath:contentPath]; | |
return [NSString stringWithContentsOfURL:contentURL | |
encoding:NSUTF8StringEncoding | |
error:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment