Mac app only works when debugging inside xcode?

bajsko

macrumors newbie
Original poster
Aug 7, 2012
2
0
Hi, i have made an app that extracts a zip files contents, everything works when i run it inside xcode, but when i just double click the .app it doesn't extract:( Do i need some permission or something please help!:(
 

rcplusplus

macrumors newbie
Aug 7, 2012
3
0
I believe that when running inside xcode the current directory is where your app is, while when running it from the finder, its the home (users/***) directory. Im not sure, but if thats the case, then you can get the directory of your app and set the current directory to that
 

rcplusplus

macrumors newbie
Aug 7, 2012
3
0
By the way, if you're using c++, then you may be able to use argv[0]. Or if you're using the Foundation framework, go through the documentation for NSFileManager and see what they have for you.
 

bajsko

macrumors newbie
Original poster
Aug 7, 2012
2
0
I believe that when running inside xcode the current directory is where your app is, while when running it from the finder, its the home (users/***) directory. Im not sure, but if thats the case, then you can get the directory of your app and set the current directory to that
Look, the directory is /Applications/AnAppWichContainsAZipFile
So, shouldn't it just work?
 

chown33

Moderator
Staff member
Aug 9, 2009
8,562
4,634
inter-prandial
Look, the directory is /Applications/AnAppWichContainsAZipFile
So, shouldn't it just work?
You'll have to provide more details than that.

First, did you make an actual bundled app, or a command-line tool? Are you passing parameters? What are they? Are you using builtin or hard-wired pathnames, or does your code dynamically determine the pathnames of files?

Second, exactly what fails? Does the program fail to find the zip file? Does it fail to open it? Fail when parsing? Fail when writing extracted data? Exactly where is it trying to write the data? Exactly what are the pathnames of the input and output files?

Third, what is the code? Did you write it yourself from scratch? Copy it from somewhere? Where?