ストーリーボードに2つのViewControllerがあります。
最初のビューコントローラには、ボタンAがあり、アクションAがあります。最初のViewControllerでボタンAを押すと、2番目のViewControllerにAの画像が表示されます。
viewcontroller.hファイルでaction-Aを宣言し、viewcontroller.mファイルでactionAを実装します。次に、firstviewcontrollerのFirstResponderにaction-Aとbutton-Aを接続します。
このアプリをテストするとき、ボタン-Aをクリックしましたが、アクション-Aは開始されませんでした。
どこで間違えましたか?私はiOSを学び始めたばかりで、プロではありません。どうか、私が何をすべきか助けてください。
viewcontroller.hで
@interface ViewController : UIViewController
{
IBOutlet UIPageControl *pagecontrol;
IBOutlet UIImageView *imageview1;
IBOutlet UIImageView *imageview2;
UIImageView *tempimageview, *bgimageview;
}
@property (nonatomic,retain) UIPageControl *pagecontrol;
@property (nonatomic,retain) UIImageView *imageview1;
@property (nonatomic,retain) UIImageView *imageview2;
- (IBAction) ButtonA_Click:(UIButton *)sender;
viewcontroller.mで
@implementation ViewController
@synthesize imageview1;
@synthesize imageview2;
@synthesize pagecontrol;
- (IBAction) ButtonA_Click:(UIButton *)sender;
{
[imageview1 setImage:[UIImage imageNamed:@"MyImage.jpg"]];
tempimageview = imageview2;
[imageview1 setHidden:NO];
[imageview2 setHidden:YES];
}