Hey there, I'm a designer thats really new to programming with xcode or Objective-C in general. I'm trying to create a few simple apps to try to get a better hang on programming the iPhone. Currently, I'm working on a very basic app which has 3 textfields, a name field and two number fields, and when you click the button, it shows in the label "name, the answer is answer" problem is, when i click the button, nothing is appearing in the label.
im pretty sure i have the code done right, i may be mistaken, i think i might have missed an outlet or something silly of the like. this is the part i get really lost on. any suggestions?
the .h:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface fordaddyAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
IBOutlet UITextField *name;
IBOutlet UITextField *myInt1;
IBOutlet UITextField *myInt2;
IBOutlet UILabel *sum;
IBOutlet UIButton *click;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
-(IBAction)click:(id)sender;
@end
the .m:
#import "fordaddyAppDelegate.h"
@implementation fordaddyAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window makeKeyAndVisible];
}
-(IBAction)click:(id)sender;
{
int sum;
sum = myInt1, myInt2;
NSLog (name, @", the answer is %i", sum);
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end
and im terribly sorry in advance, the preview doesnt look to pretty :/