Xcode7.2, OS10.11.2を使用しています。
UIStepperの値に応じてラベルの値を変えるプログラムを作成しているのですが、ビルドしてStepperをクリックしても値が正常に表示されませんでした。
そのためログを取って見てみるとどうやらポインタの値が出てきているようですが、解決方法が分かりません。
初歩的なミスかとは思いますが、どうがご教授願います。
以下はソースです。
StepprtViewController.h #import <UIKit/UIKit.h> @interface StepprtViewController : UITableViewController @property (weak, nonatomic) IBOutlet UIStepper *stepper; @property (weak, nonatomic) IBOutlet UILabel *label; - (IBAction)stepperchanged:(id)sender; @end
Objective
1StepprtViewController.m 2 3#import "StepprtViewController.h" 4 5@interface StepprtViewController() 6 7@end 8 9@implementation StepprtViewController 10 11- (void)viewDidLoad { 12 [super viewDidLoad]; 13 // Do any additional setup after loading the view, typically from a nib. 14} 15 16- (void)didReceiveMemoryWarning { 17 [super didReceiveMemoryWarning]; 18 // Dispose of any resources that can be recreated. 19} 20- (IBAction)stepperchanged:(id)sender { 21 self.label.text = [NSString stringWithFormat:@"%zd",self.stepper.value]; 22 NSLog(@"%zd",self.stepper.value); 23} 24@end 25
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。