Opening file with C++ iostream from application bundle
Opening file with C++ iostream from application bundle
- Subject: Opening file with C++ iostream from application bundle
- From: Carlos Eduardo Mello <email@hidden>
- Date: Sat, 18 Apr 2009 22:50:56 -0300
Hi everyone,
my Cocoa app (Objective-C++) works perfectly from within Xcode.
However when I double click the application in Finder it does not load
my data file.The file is a short text file which was placed next to
the executable in the "build>Debug" or "build>Release" folders. It is
loaded with standard C++ <iostream> methods. Now, however, I'd like to
place this file somewhere within the Application contents folder and
load it from there, so I can use the app as a standalone.
1. I know this is not the recommended way to open a file in a Cocoa
App, but this is just a quick utility for use in class, so I don't
wan't to change my file loading code and deal with File dialogs,
bundle loading or preferences. This is not really a preferences file
either. It contains some data which is vital to the application but
will not be modified by the user.
2. Where should I place the file?
3. How do I direct my executable to it so that I can load it with my
stream reading code?
4. Can it be done with a path in info.plist or somethinglike that?
Thanks already for any help/suggestion/link.
Carlos
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden