JC Web Concepts

Custom Web Developments

Basic Cocoa App

| Comments

Well I started looking into Cocoa programming so I could develop some Mac applications. So here is my first tutorial on how to develop using Objective-C language.



I will post the Hello.h and the Hello.m files cause I know they are tuff to read.

Hello.h

Hello.h
1
2
3
4
5
6
7
8
9
10
11
12
13
//  Hello.h
//  HelloWorldApp

//  Created by John Costanzo on 7/13/09.
//  Copyright 2009 JC Web Concepts. All rights reserved.

#import  
@interface Hello : NSObject
{
IBOutlet NSTextField *textField;
}
- (IBAction)sayHello:(id)sender;
@end
Hello.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//  Hello.m
//  HelloWorldApp

//  Created by John Costanzo on 7/13/09.
//  Copyright 2009 JC Web Concepts. All rights reserved.

#import "Hello.h"  
@implementation Hello
- (IBAction)sayHello:(id)sender
{
  //Say Hello
  [textField setStringValue:@"Hello, World!"];
}
@end

I hope this has helped you with getting the basic of Xcode and developing an application for the Mac. My next video on this will be tweaking the GUI to look a little better.