Amazon.com Widgets Why this~~~~?
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2013, 11:00:50 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
|-+  Old Stuff
| |-+  Chapter Study
| | |-+  Chapter 2 - Programming in Objective-C
| | | |-+  Why this~~~~?
Pages: [1]   Go Down
Print
Author Topic: Why this~~~~?  (Read 389 times)
UnicornLeo
Newbie
*
Posts: 1


Email




« on: May 27, 2012, 08:01:57 AM »


I just read your book(3rd edition) for several minutes.
I've tried to type like this


Code: (Objective-C)
#import <Foundation/Foundation.h>

int main (int argc, const char * argv[])   {
    NSAutoreleasePool * pool = [[ NSAutoreleasePool alloc ] init ];
    NSLog (@"Programming is fun!");
    [Pool drain];
    return 0;
}


in Xcode, but there is no color in such as NSAutoreleasePool and NSLog

they are just black. And they cannot run.

why?Huh
« Last Edit: May 27, 2012, 07:42:41 PM by happyzhb » Logged
happyzhb
Administrator
Newbie
*****
Posts: 47


Email




« Reply #1 on: May 27, 2012, 07:48:34 PM »

First of all, the title of this section clearly says this is for the FOURTH edition. You are posting questions about 3rd Edition, so I am moving this to the right place.

Second, you need to get the latest 4th edition if you plan to hope everything work in the latest Xcode 4.2.

Third, use the code below, you should be able to run:

Code: (Objective-C)
//Program 2.1
// First program example
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
@autoreleasepool {
NSLog (@"Programming is fun!");
}
return 0;
}

Post back if you have further questions, happy programming!
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.