Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 7, 2012, 11:51 AM   #1
bajsko
macrumors newbie
 
Join Date: Aug 2012
app only works when debugging inside xcode?

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!
bajsko is offline   0 Reply With Quote
Old Aug 7, 2012, 04:58 PM   #2
rcplusplus
macrumors newbie
 
Join Date: Aug 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
rcplusplus is offline   0 Reply With Quote
Old Aug 7, 2012, 05:16 PM   #3
rcplusplus
macrumors newbie
 
Join Date: Aug 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.
rcplusplus is offline   0 Reply With Quote
Old Aug 8, 2012, 03:47 AM   #4
bajsko
Thread Starter
macrumors newbie
 
Join Date: Aug 2012
Quote:
Originally Posted by rcplusplus View Post
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?
bajsko is offline   0 Reply With Quote
Old Aug 8, 2012, 11:41 AM   #5
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by bajsko View Post
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?
chown33 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:39 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC