Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
It seems that now-a-days Google is not what it once was with all the mucked up searches. I am in need of advice as I am a noob of sorts with Mac development. I am designing a advanced GUI installer and I need to figure out how to get it to look for for a file in a specific location and then if not there copy it? Also how do I run system shell commands via the xcode C++?
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
so the fopen() will allow me to see if a file exist and if not copy it there?
 

white89gt

macrumors regular
Jan 18, 2006
133
0
NSFileManagers can do what you're talking about if you're using Cocoa and Objective-c. Otherwise you're stuck with what yeroen mentioned.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
I do appreciate, it has been a very long time since I have messed with C++. I have been using Perl mostly and the last time I used C++ was in college 8 years ago. I know it can be taken negatively, however I had no idea what to Google. File Handling comes up with some major weird stuff at first.

I do appreciate everything you have given me today as I am having to learn more advanced stuff for work (we are migrating to C++ from Perl although we will never stop using Perl ;) so I am not out of a job yet lol ).

I have two last questions, for now ;).


The first is about setting a value of checkboxes to an array. What I am thinking is something like this:

Code:
-(IBAction)Nextbutton:(id)sender
{

if([checkboxname isEqualToString:@"Printer1"]  == YES) {

  printerarray[i] = Printer1;
} else if{
the other 17 checkboxes
}

where hitting the next button would check to see if every checkbox is click or not, then pop up the next window and display the list of the printers in the array. The question is do I have the correct format and is this the best way?

The next question, I would still just use a standard text cell to display the list to confirm?

Thank you again in advance for your patience for my ignorance and for your advice and help.
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
NSFileManagers can do what you're talking about if you're using Cocoa and Objective-c. Otherwise you're stuck with what yeroen mentioned.

I wouldn't call it "stuck", since the C API is simple, fast, portable and accessible from C, C++, and Objective C alike.

Actually, since this is C++, the OP should, for consistency, be using standard IOStreams classes (ifstream, ofstream, etc.) for file I/O.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
with using the Next button to display the next window, how do I have it preform two actions. I can either have it performClose on the main window or bring the next one out of hiding. How do I do both?
 

white89gt

macrumors regular
Jan 18, 2006
133
0
I wouldn't call it "stuck", since the C API is simple, fast, portable and accessible from C, C++, and Objective C alike.

Actually, since this is C++, the OP should, for consistency, be using standard IOStreams classes (ifstream, ofstream, etc.) for file I/O.

You're right, stuck isn't the right word, and ifstreams and ofstreams are relatively easy to work with. cppreference.com is a great place to find info on C++ coding.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
basically both at the same time. The next button will basically close the main start screen, open the next one and then display a list of the printers you have decided to install.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
This is what I have in the script. However the interface building will only let me have one Sent action for the button though and it seems that the sent action is the only thing that is executed.

Code:
- (IBAction)NextButton:(ID)sender {
  [prnSelector performClose:self];
  [prnOverview orderFront:self];
}
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
After a few more tests, it doesn't even look at the code in AppControler.m even when I drag AppController.h on top of the Blue box.

It just does whatever is in the the sent/received Actions

What did I do wrong?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.