File input/output on xcode

I'm not sure if anyone here uses xcode, but I was wondering when I make a file were does it store it at? I know on C++ express it goes to Documents>visual studio> "project name" > "project name". I checked my xcode file but couldn't find it. Any suggestions?
closed account (1vRz3TCk)
'Right Click' on the file in navigation area of Xcode and select show in finer from the context menu.
Still can't find it. I even wrote a program to write a file to see if that's where it went, still nothing.
Last edited on
Show In Finder has been a part of almost every XCode context menu for as long as I've been using XCode... What version of XCode are you using?
I'm using version 4.1. I know where finder is but maybe i'm doing something little wrong. Here is the code I wrote just to write a file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    ofstream Newfile;
    Newfile.open("newfile.txt");
    Newfile << "Hello ";
    
    
    
    return 0;
}


I click on the "show in finder" button but still I can't find where my newfile.txt was stored at. all I see is main.cpp
closed account (1vRz3TCk)
Ah, I misunderstood what file you where looking for. It is likely to be in the project directory somewhere but you could just type the name into the search box of finder.
Look in your project's directory (where the .xcodeproj file lives) and there should be a directory called "build". In there there should be a directory called "Debug" or "Release" depending on which configuration you built. In one of those should be your program's executable along with the file you just created.

Scratch that, I was using XCode 3.2.6

In XCode 4, if you look in your project navigator, there should be a folder called "Products". Expand that and you'll see your executable file. Right click (or Ctrl click if you don't have a two buttoned mouse) on the executable file and choose "Show in Finder". You should then see your executable along with the file it just created.

It seems that the build products from your project go into:
/Users/<username>/Library/Developer/XCode/DerivedData/<yourprojectname>/Build/Products/Debug

Not sure if this location can be changed, I don't use XCode 4 very much.
Last edited on
I Use Xcode

for some reason alot of people have this issue with Xcode for some reason it is a Product Error.. you need to go into Settings and do something within those Settings for your Project..

I just move to Netbean
Topic archived. No new replies allowed.