Resources folder path in cocoa app
I am working on Mac OS X app which using some c files, and i have a configuration file i add it to the app resources.
My question is “What is the relative path of resources folder?”
and it works fine only when I run my app from xCode, otherwise it’s doesn’t work!
I thought the app starts from “MacOS” folder, so i used this path:
but it also didn’t work 🙁
any help please
Solutions Collect From Internet About “Resources folder path in cocoa app”
Using relative paths is asking for trouble. Fortunately Cocoa will give you an absolute path:
NSBundle *myBundle = [NSBundle mainBundle]; NSString *absPath= [myBundle pathForResource:@"config" ofType:@"cfg"];
- Landscape-only app still autorotates to portrait in iOS7
- Get current iPhone device timezone date and time from UTC-5 timezone date and time iPhone app?
- Beacon / IOS CLLocationManager get current region
- mouseDown: not firing in WebView subclass
- How to change image to previous state if other row is selected in TableView didSelectRowAtIndexPath function?
- difference between AudioQueue time and AudioQueue Device time
- How to set size of UIImageView equal to size of UIImage?
- Map Object into 2D Array Swift for TableView Sections
- How can you display info screen on iPhone during call
- Get scroll position of UIPageViewController
- setKeepAliveTimeout and BackgroundTasks
- ios unique identifier across installs
- SpriteKit game crashes when two SKPhysicsContacts are detected
- Handling autorotation for one view controller in iOS7