Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aegzorz
Created June 1, 2012 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aegzorz/2850852 to your computer and use it in GitHub Desktop.
Save aegzorz/2850852 to your computer and use it in GitHub Desktop.
static NSString* __AppResources[] = {
@"resources/images/my-image.png",
@"resources/images/my-image2.png",
@"resources/images/subfolder/my-image.png",
@"resources/test.pdf",
nil
};
static const NSUInteger kImageResourcesImagesMyImage = 0;
static const NSUInteger kImageResourcesImagesMyImage2 = 1;
static const NSUInteger kImageResourcesImagesSubfolderMyImage = 2;
static const NSUInteger kFileResourcesTest = 3;
static __inline__ NSString* GetResourcePath( const NSUInteger identifier ) {
return ( identifier < 4 ) ? __AppResources[ identifier ] : nil;
}
static __inline__ UIImage* GetImageWithID( const NSUInteger identifier ) {
return [UIImage imageNamed:GetResourcePath( identifier )];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment