0

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

mohdajami
  • 9,604
  • 3
  • 32
  • 53
  • Do not call [super dealloc] as the first line of your dealloc method. Move it to the end of the method. – bneely Feb 16 '12 at 10:42

1 Answers1

0

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.

Community
  • 1
  • 1
ikuramedia
  • 6,038
  • 3
  • 28
  • 31