Friday, April 20, 2012

Two different header files one implementation file

Header Files: SettingsVC.h ViewController.h



Implementation Files: SettingsVC.m ViewController.m



In ViewController.m, I imported SettingsVC.h using this line of code at the top



import "SettingsVC.h"
so I can obtain a value from a stepper from a different view.



In SettingsVC.h I have a line of code that says IBOutlet UIStepper *mainStepper;



that is assigned to a stepper.



When I try to access the value of the stepper from the ViewController.m by doing this mainStepper.value it doesn't work but it works in the Settings.m Thanks for any help.



EDIT FULL SECTIONS
SettingsVC.h FILE



@interface SettingsVC : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>     {

IBOutlet UILabel *mainTimeShow;
//IBOutlet UILabel *armTimeShow;
#import "ViewController.h"
#import "SettingsVC.h"

@interface ViewController ()

@end

@implementation ViewController

}


ViewController.m FILE



#import "ViewController.h"
#import "SettingsVC.h"

@interface ViewController ()

@end

@implementation ViewController


-(IBAction)onUpArmStart:(id)sender {

mainInt = mainStepper.value + 0003;

}

@end




No comments:

Post a Comment