0902131950@
090213 そして Sadunさんの iPhone cockbookがきたら、すぐにできた!
やはりかんたんなことだったが、この答えは出なかったと思う。
//
// Test1AppDelegate.h
// Test1
//
// Created by masa on 09/01/29.
// Copyright __MyCompanyName__ 2009. All rights reserved.
//
#import
@interface Test1AppDelegate : NSObject
UIWindow *window;
IBOutlet UITextField *nameField;
IBOutlet UITextField *numberField;
IBOutlet UIButton *button1;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITextField *nameField;
@property (nonatomic, retain) IBOutlet UITextField *numberField;
@property (nonatomic, retain) IBOutlet UIButton *button1;
- (IBAction)GO:(id)sender;
end
//
// Test1AppDelegate.m
// Test1
//
// Created by masa on 09/01/29.
// Copyright __MyCompanyName__ 2009. All rights reserved.
//
#import "Test1AppDelegate.h"
@implementation Test1AppDelegate
@synthesize window;
@synthesize nameField;
@synthesize numberField;
@synthesize button1;
- (IBAction)GO:(id)sender {
int a,b,c;
// float a,b,c;
// a = [[nameField text] floatValue];
a = [[nameField text] intValue];
b = 100.0;
c = a * b;
// [numberField setText: [NSString stringWithFormat:@"%3.1f%%",c]];
[numberField setText: [NSString stringWithFormat:@"%d",c]];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after application launch
[window makeKeyAndVisible];
}
- (void)dealloc {
[window release];
[nameField release];
[numberField release];
[super dealloc];
}
@end