Amazon.com Widgets Page 16
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 27, 2014, 10:36:42 PM
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
|-+  Old Stuff
| |-+  Program Examples
| | |-+  Chapter 2
| | | |-+  Page 16
Pages: [1]   Go Down
Print
Author Topic: Page 16  (Read 2004 times)
amm0409
Newbie
*
Posts: 3


Email




« on: January 24, 2011, 08:08:34 PM »

Every things been fine up till "Using Terminal."
I opened up Terminal typed "mkdir Progs" which created a folder.  Then I typed "cd Progs" and finally "vi prog1.m"  I am assuming this is where you type or copy and paste the program code from 2.1.
I did that but nothing is being saved into the Progs folder which means when I open a new shell and typed "gcc -framework Foundation prog1.m -o prog1" nothing is found even if i type "cd Progs" then the gcc -framework.  Any help on what to do after you enter "vi prog1.m"  the steps you take.  Copy and Paste works but if you press enter after typing "// First Program Example" "E486: Pattern not found: First Program Example.  If I copy and paste at the bottom of terminal window it says "-INSERT-"

// First Program Example

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSLog(@"Programming is Fun");
    
   [pool drain];
    return 0;
}
Logged
amm0409
Newbie
*
Posts: 3


Email




« Reply #1 on: January 24, 2011, 08:19:07 PM »

ok... so I had to search vi commands on google.  Found out that pressing escape takes you to command line and away from "insert"  then I typed : w <return> which saved the file in the directory Progs and bingo it worked.  Come on man that was some missed information there especially if the reader doesnt know Terminal Smiley
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114







« Reply #2 on: January 24, 2011, 11:09:01 PM »

Umm, sorry if it wasn't clear, but that section wasn't intended to teach how to use tools like Terminal or vi; it assumes you are already familiar with them.  The second sentence of that section reads as follows: If you’re used to using the UNIX shell and command-line tools, you might want to edit, compile, and run your programs using the Terminal application..

Cheers,

Steve
« Last Edit: January 24, 2011, 11:11:44 PM by skochan » Logged
amm0409
Newbie
*
Posts: 3


Email




« Reply #3 on: January 25, 2011, 10:09:22 AM »

I figured that from reading the last paragraph before "Explanation of Your First Program" on page 18:)  I just really wanted to do it in Terminal and didnt know what I was doing, but with a will there is a way I guess.
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.