
Hello World iPhone Tutorial
2 years ago
A screencast tutorial to help beginner iPhone programmers get started. This tutorial shows how to draw "Hello World!" text on the screen.
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo

Previous Week
-----------------------------------------------------
import "MyView.h"
#define TEXT_LABEL_FONT_SIZE 30.0
#define TEXT_FIELD_HEIGHT_MULTIPLIER 2.0
@implementation MyView
- (id)initWithFrame:(CGRect)aRect
{
[super initWithFrame:aRect];
self.backgroundColor = [UIColor whiteColor];
CGRect contentFrame = self.frame;
CGFloat leftMargin = 90.0;
CGFloat textFieldWidth = contentFrame.size.width * 0.72;
CGFloat textFieldOriginX = (contentFrame.size.width - textFieldWidth) / 2.0;
CGRect labelFrame = CGRectMake(textFieldOriginX, leftMargin, textFieldWidth, TEXT_LABEL_FONT_SIZE * TEXT_FIELD_HEIGHT_MULTIPLIER);
UILabel *someText = [[UILabel alloc] initWithFrame:labelFrame];
someText.text = @"Hello World!";
someText.font = [UIFont systemFontOfSize:TEXT_LABEL_FONT_SIZE];
someText.textColor = [UIColor redColor];
someText.textAlignment = UITextAlignmentCenter;
[self addSubview:someText];
[someText release];
return self;
}
It's 100x easier/faster to develop C apps on Microsoft platforms using Visual Studio for sure.
Don't get me wrong - the video is good, but in Visual Studio a C++ hello world app takes about 1 minute to have up an running. OS-X is nice, but, development seems painfully slow.
Nice to see your tutorial.
I was looking for some nice tutorial since long. I am new to this platform. I am on windows. Can you suggest me what all I need to start iPhone programming. I am good in C/C++. Also which MAC system will be good to purchase.
Even in case I would like to start Web Application for iPhone, is there anything special that we need to do?