Amazon.com Widgets How do we actually run the example programs and excersizes
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2014, 01:14:42 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Programming in Objective-C, 4th edition
| |-+ Chapter 16
| | |-+ How do we actually run the example programs and excersizes
Pages: [1] Go Down
Print
Author Topic: How do we actually run the example programs and excersizes (Read 1682 times)
elkie13
Newbie
*
Posts: 17






on: April 04, 2012, 01:21:38 PM

Alright, stupid question but I am totally lost on this chapter until I get help.  How in the world do I actually run the example programs in chapter 16?  I have run everything until now through xcode, but I never am able to test these programs because I never get an opportunity to type anything into the terminal.  My background in programming before this was all windows based, so can you give instructions to someone like me who doesn't know their way around terminal commands?
Logged
Waiting
Global Moderator
Full Member
*****
Posts: 113






Reply #1 on: April 04, 2012, 01:25:30 PM

Click the window at the bottom of the screen that shows the program output and type in there.
Logged
elkie13
Newbie
*
Posts: 17






Reply #2 on: April 04, 2012, 01:57:24 PM

For example program 16.6, I run the program and it kicks me out in the first if statement if([args count]!=3), I never get an opportunity to type anything in the window at the bottom of the screen.
Logged
elkie13
Newbie
*
Posts: 17






Reply #3 on: April 04, 2012, 04:10:43 PM

Ok I figured it out by looking at the forum for the third edition.

So you have to run this in terminal.  For those of you like me who need help finding it its under applications\utilities.

then you have to drill down to the directory where your executable is.  cd is the command for changing directories.  and to find where your executable is look in xcode preferences locations.  mine was in something like user/library/developer/xcode/diriveddata/copy-anjuaxhihxqnidbbpuinxvjdvmzb/build/products/debug

Now the thing that was confusing to me was that the name of program 16.6 was "copy", like he's trying to overwrite the terminal command "copy".  The output he shows you in the book is what you need to type into the terminal. Course your going to want to put the same files into that directory or it won't work.  Also I could not get my program to run by just typing the name of my program at the prompt with the files to work with like he did, I had to type ./copy fileA fileB.

So I hope I'm not the only person who had this confusion and I hope this helps someone like me.

Now since I've wasted my whole day on this and I'm pretty irritated right now, forgive me if I go on a rant for a second.  If I were the author of a book and a bunch of people had a problem with something on one edition, I would try to clarify my lessons in the next edition.  The beginning of this book was absolutely outstanding, but since about chapter 11 it feels like this book was rushed and pretty obvious information that would help people understand has been left out.   Myself and others have posted questions and clarifications on the forum, and it would be nice to see this stuff considered for the next edition. 
Logged
bmbernie
Newbie
*
Posts: 4


Email




Reply #4 on: May 02, 2012, 02:54:27 PM

I just want to say this:

I have never used a mac before, never seen objective-c, or used xcode.

It took about 2 mins to find out that all you need to do is edit the scheme for the programs which will allow you to send arguments to the command line.  You can also set the cwd for the program to be run in, which i find useful because I have my source code for all of the programs stored in different directories.

Considering all the people who bought the book and read it and had no problems I think you must be in the minority here.

The author does a good job of hand holding for most of this book, but in the real world you are going to have to be more resourceful.  I think that by not coddling the reader the author shows respect for the intended audience and in some ways forces us to learn something.  I found it to be a useful tactic employed by kochan.
Logged
blacklisted
Newbie
*
Posts: 3


Email




Reply #5 on: March 29, 2013, 04:00:29 AM

elkie13, I agree.

It would have been nice if the author would have mentioned the terminal in the book.  Sometimes (after reading the book), I think the author just enjoys throwing us a curve ball. 

Thanks for the post.



Logged
blacklisted
Newbie
*
Posts: 3


Email




Reply #6 on: March 29, 2013, 04:18:55 AM

bmbernie,

even though it took me more than 2 min.  I like your solution.
Logged
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.