【发布时间】:2013-12-04 06:44:25
【问题描述】:
【问题讨论】:
-
是的,这是可能的。你试过什么?什么对你不起作用?发布您的代码。
标签: ios objective-c
【问题讨论】:
标签: ios objective-c
这样试试,
- (IBAction)buttonAction:(UIButton *)btn {
yourNextVCobject.buttonTitle = [NSString stringWithFormat:@"%@",btn.titleLabel.text];
// then push to ur vc.
}
在你的下一个 VC 中,
在.h
@property (nonatomic, retain) NSString *buttonTitle;
在.m
[yourAnotherBtn setTitle:self.buttonTitle forState:UIControlStateNormal];
【讨论】:
您可以使用以下代码将点击按钮的标题设置为指向另一个按钮。
-(IBAction)clickbutton:(id)sender
{
UIButton *firstButton = (UIButton *)sender;
NSString *neededtitle = [NSString stringwithformat:@"%@",firstButton.currentTitle];
[anotherbutton setTitle:neededtitle forState:UIControlStateNormal];
}
【讨论】: