0

iOSでテキストをuibuttonに変更すると間違いがあります

@interface ViewControllerSonidos : UIViewController{
    __weak IBOutlet UIButton *initgame;
}
@property (weak, nonatomic) IBOutlet UIButton *initgame;
- (IBAction)Reproducir:(id)sender;

私の実装ファイルは次のようになります。

@implementation ViewControllerSonidos
@synthesize initgame

- (IBAction)Reproducir:(id)sender {
    [initgame setTitle:@"Continue" forState:UIControlStateNormal];
}

しかし問題は、テキストが決して変更されないことです。前もって感謝します!

4

6 に答える 6

0
-(void)btnChanged
{
    [m_btnSample setTitle:@"Continue" forState:UIControlStateNormal];

}
于 2013-07-18T05:55:38.827 に答える
0

に問題がある可能性がIBOutletあります。XIB で接続するのを忘れていました。それ以外の場合は正常に動作します。

于 2013-07-18T05:54:03.957 に答える
0

はい、同じコードが機能したため、IBOutlet 接続を確認してください。

于 2013-07-18T06:01:55.247 に答える