【发布时间】:2013-07-18 05:50:22
【问题描述】:
我在 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];
}
但问题是文本永远不会改变,有人看有什么问题吗? 提前致谢!
【问题讨论】:
-
您确定 UIButton 已连接到 IBOutlet?
-
你检查过这个方法是否真的被调用了吗?
-
它为我工作。你能发布整个代码
-
是的,UIButton是连接的,被tape的时候方法执行其他代码
-
你能同时显示xib和.h吗
标签: ios objective-c uibutton uilabel