【发布时间】:2015-04-07 23:39:47
【问题描述】:
在我的视图控制器中,我有 6 个按钮 (IBAction buttonDown(tagged 0 - 5)),以及它们对应的详细信息披露按钮 (UIButton*closureButton(tagged 0 - 5))。
我想知道是否有一种方法可以默认隐藏所有详细信息披露按钮,但是如果按下标记为 0 的按钮,则会显示标记为 0 的详细信息公开按钮等。
这是我目前在 ViewController.m 文件中的代码
- (void)viewDidLoad{
[super viewDidLoad];
_stopSound.hidden = YES;
}
- (IBAction)stopSound:(UIButton *)sender {
P11AppDelegate* app = [[UIApplication sharedApplication] delegate];
[app.host stop];
_stopSound.hidden = YES;
}
- (IBAction)buttonDown:(UIButton *)sender
{
P11AppDelegate* app = [[UIApplication sharedApplication] delegate];
[app.host start];
[app playSound:sender.tag];
_stopSound.hidden = NO;
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
UIButton* disclosureButton = sender;
P11AppDelegate* app = [[UIApplication sharedApplication] delegate];
app.editIndex = disclosureButton.tag;
}
@end
【问题讨论】:
标签: ios objective-c