Надеюсь, кто-то может с этим справиться!UIButtons, похоже, не влияет на другие элементы управления моего интерфейса.
Я изучал учебники по созданию приложений для iOS и загрузил примерный проект.
Этот проект, кажется, запускается и компилируется для всех остальных, кроме меня!
Когда я запускаю приложение в симуляторе, ни одна из кнопок или текстовых полей не работает. Отклика и ошибок нет.
У кого-нибудь еще была эта проблема?
FirstViewController.h
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController {
UITextField *tempTextBox;
UILabel *calcResult;
}
@property (nonatomic, retain) IBOutlet UILabel *calcResult;
@property (nonatomic, retain) IBOutlet UITextField *tempTextBox;
- (IBAction) degreeConvert:(id)sender;
- (IBAction) backgroundTouchedHideKeyboard:(id)sender;
@end
FirstViewController.m
#import "FirstViewController.h"
@implementation FirstViewController
@synthesize tempTextBox, calcResult;
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)degreeConvert:(id)sender
{
NSLog(@"IBAction triggered succesfully");
double fahren = [tempTextBox.text doubleValue];
double celcius = (fahren - 32)/1.8;
[tempTextBox resignFirstResponder];
//create new string with celcius formatting
NSString *convertResult = [[NSString alloc] initWithFormat:@"Celcius:%f", celcius];
//output converted result to calcResult Label
calcResult.text = convertResult;
}
-(void) backgroundTouchedHideKeyboard:(id)sender
{
[tempTextBox resignFirstResponder];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.tempTextBox = nil;
self.calcResult=nil;
}
@end
Этого недостаточно, чтобы ответить на вопрос. – trojanfoe