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 online now   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

Similar Threads
thread Thread Starter Forum Replies Last Post
The App Store app thinks Xcode is installed, but I deleted Xcode. moonman239 Mac Applications and Mac App Store 3 May 6, 2014 05:53 PM
C++ XCode debugging kamy Mac Programming 5 Apr 1, 2014 02:11 AM
XCODE Parse Json with 4 arrays inside joak Mac Programming 6 Mar 10, 2014 03:24 PM
Xcode 4.6 debugging thrill4rishabh Mac Programming 10 Nov 28, 2013 04:59 PM
Debugging XCode on real device - keychain probs martinjm iPhone/iPad Programming 5 Nov 1, 2012 10:04 AM

Forum Jump

All times are GMT -5. The time now is 12:26 PM.

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

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