UISlider - 参数 - iphone
在我的应用程序中,我有一个 UISlider,其中 file.h 是:
@interface Mapa : UIViewController {
UILabel *label;
UISlider *slider;
}
@property(nonatomic, retain) IBOutlet UILabel *label;
@property(nonatomic, retain) IBOutlet UISlider *slider;
-(IBAction)sliderValueChanged:(UISlider *)sender;
-(IBAction) OpenList:(id)sender;
-(IBAction) OpenMap:(id)sender;
和 file.m:
@synthesize label;
@synthesize slider;
-(IBAction)sliderValueChanged:(UISlider *)sender {
label.text = [NSString stringWithFormat:@"%f", sender.value];
}
- (void)dealloc {
[super dealloc];
[label release];
[slider release];
}
对我的 uislider 标签目标完成此操作,我得到绑定到 UISlider 的标签上的数字,另一个屏幕来调用地图,如何这个值标签会跳转到另一个屏幕吗?
谢谢
In my application I have a UISlider where file.h is:
@interface Mapa : UIViewController {
UILabel *label;
UISlider *slider;
}
@property(nonatomic, retain) IBOutlet UILabel *label;
@property(nonatomic, retain) IBOutlet UISlider *slider;
-(IBAction)sliderValueChanged:(UISlider *)sender;
-(IBAction) OpenList:(id)sender;
-(IBAction) OpenMap:(id)sender;
And file.m:
@synthesize label;
@synthesize slider;
-(IBAction)sliderValueChanged:(UISlider *)sender {
label.text = [NSString stringWithFormat:@"%f", sender.value];
}
- (void)dealloc {
[super dealloc];
[label release];
[slider release];
}
done this to me uislider goal of the label, I get the number that's out on the label bound to the UISlider, another screen to call a map, how this value label step to the other screen?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的“其他屏幕”是另一个 UIViewController,那么在实例化新的 UIViewController 后,您将在调用 PushViewController 或 PresentModalViewController 之前在新的 UIViewController 上设置参数。
如果您使用的是 UIStoryboard,那么您可以在“prepareForSegue”中设置新视图控制器的参数。有关详细信息,请参阅此问题如何传递prepareForSegue:对象。
Assuming your 'other screen' is another UIViewController, then after instantiating the new UIViewController, you would set the parameters on the new UIViewController before calling either pushViewController or presentModalViewController.
If you're using a UIStoryboard then you can set the parameters of the new view controller in 'prepareForSegue'. See this question How to pass prepareForSegue: an object for details.