Вот как раньше было просто - PRINT "Hello World!" нет проблем. Ну или:
PROGRAM HELLO
PRINT *, "Hello World"
END PROGRAM HELLO
Ну можно еще продолжить в разумных переделах...
А сейчас вот так:
File: HelloWorldAppDelegate.h
#import
@class HelloWorldViewController;
@interface HelloWorldAppDelegate : NSObject {
UIWindow *window;
HelloWorldViewController *viewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet
HelloWorldViewController *viewController;
@end
File: HelloWorldAppDelegate.m
#import "HelloWorldAppDelegate.h"
#import "HelloWorldViewController.h"
@implementation HelloWorldAppDelegate
@synthesize window;
@synthesize viewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
@end
File: HelloWorldViewController.h
#import
@interface HelloWorldViewController : UIViewController {
UILabel *label;
UIButton *button;
}
@property (nonatomic, retain) IBOutlet UILabel *label;
-(IBAction)sayHello:(id) sender;
@end
File: HelloWorldViewController.m
#import "HelloWorldViewController.h"
@implementation HelloWorldViewController
@synthesize label;
-(IBAction) sayHello:(id) sender {
label.text = @"Hello World";
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)viewDidUnload {
}
- (void)dealloc {
[label release];
[button release];
[super dealloc];
}
@end
Вам страшно? Мне тоже.
Секс на лыжах в гамаке стоя. Не иначе.