Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-29-2011, 09:05 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 1
OnScreen is on a distinguished road
Default Holzner Quick Start Objective-C

I've used the SDK to start learning iPhone programming. Going back a step, as recommended, to learn some Objective-C. Using book by Steven Holzner, Visual Quickstart Guide, Objective-C. Followed directions to create my first program on my iMac. Compiles and runs, directions say "you should see this message"... where? The example is just using a simple printf command. Using Project - Command Line Tool - Foundation...


#import <Foundation/Foundation.h>

int main (void) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

// insert code here...
printf("Welcome to Objective-C.");


NSLog(@"Hello, World!");
[pool drain];
return 0;
}


also tried...


#import <stdio.h>

int main (void)
{
printf("Welcome to Objective-C!");

return 0;
}


I don't see any other reference to <stdio.h>
OnScreen is offline   Reply With Quote
Old 08-27-2011, 05:19 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 17
Majora is on a distinguished road
Default

Now I am honestly a total noob, so I'm sorry if I get this wrong. But I'm pretty sure the printf() function is for C, not Objective-C. If you want to display that line just use another NSLog string.
Majora is offline   Reply With Quote
Old 09-03-2011, 07:44 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 66
Sami Gh is on a distinguished road
Default

Quote:
Originally Posted by Majora View Post
Now I am honestly a total noob, so I'm sorry if I get this wrong. But I'm pretty sure the printf() function is for C, not Objective-C. If you want to display that line just use another NSLog string.
Actually printf() will also work on objective-c program. Objective-c is a layer on top of C language, so you can use c language freely in your program.
You should be able to see the output on the console.
view->debug area->activate console will make it appear.
__________________
Sami Gh is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 479
15 members and 464 guests
7twenty7, AlanFloyd, AppsBlogger, David-T, HemiMG, iAppDeveloper, imac74, Jaxen66, lovoyl, mutantskin, Paul Slocum, SLIC, solardrift, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,683
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, unicornleo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:16 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0