app only works when debugging inside xcode?

Discussion in 'Mac Programming' started by bajsko, Aug 7, 2012.

  1. bajsko macrumors newbie

    Aug 7, 2012
    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!:(
  2. rcplusplus macrumors newbie

    Aug 7, 2012
    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
  3. rcplusplus macrumors newbie

    Aug 7, 2012
    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.
  4. bajsko thread starter macrumors newbie

    Aug 7, 2012
    Look, the directory is /Applications/AnAppWichContainsAZipFile
    So, shouldn't it just work?
  5. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    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?

Share This Page