Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ResourcePath.hpp"
- #import <Foundation/Foundation.h>
- ////////////////////////////////////////////////////////////
- std::string resourcePath(void)
- {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- std::string rpath;
- NSBundle* bundle = [NSBundle mainBundle];
- if (bundle == nil) {
- #ifdef DEBUG
- NSLog(@"bundle is nil... thus no resources path can be found.");
- #endif
- } else {
- NSString* path = [bundle resourcePath];
- rpath = [path UTF8String] + std::string("/");
- }
- [pool drain];
- return rpath;
- }
Advertisement
Add Comment
Please, Sign In to add comment