http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/xcode_quick_start/010-Tutorial_Using_Xcode_to_Write_Hello_World/hello_world_tutorial.html

//
//  HelloView.m
//  Hello
//
//  Created by JON MOODY on 11/15/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "HelloView.h"

@implementation HelloView

- (id)initWithFrame:(NSRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

- (void)drawRect:(NSRect)dirtyRect
{
    // Drawing code here.
    NSString * t_string=@"Hi! this is HelloView";
    NSPoint point=NSMakePoint(100,100);
    NSMutableDictionary*  t_font_attributes=[[NSMutableDictionary alloc] init];
    NSFont *t_font=[NSFont fontWithName:@"Futura-MediumItalic" size:42];
    [t_font_attributes setObject:t_font forKey:NSFontAttributeName];
    
    [t_string drawAtPoint:point withAttributes:t_font_attributes];
    
    
    
}

@end

sample code:
001-Begin-Hello

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply