Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7812059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:23:21+00:00 2026-06-02T04:23:21+00:00

Header Files: SettingsVC.h ViewController.h Implementation Files: SettingsVC.m ViewController.m In ViewController.m, I imported SettingsVC.h using

  • 0

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.

New stuff for Vikings

SettingsVC.h FILE

#import <UIKit/UIKit.h>

@interface SettingsVC : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate> {

IBOutlet UILabel *mainTimeShow;
IBOutlet UILabel *armTimeShow;
IBOutlet UILabel *defuseTimeShow;
IBOutlet UIStepper *armStepper;
IBOutlet UIStepper *defuseStepper;
IBOutlet UIStepper *mainStepper;


}

-(IBAction)goToClock;
@property (nonatomic, retain) UIStepper *mainStepper;
-(IBAction)mainTimeStepper;
-(IBAction)armTimeStepper;
-(IBAction)defuseTimeStepper;

@end

SettingsVC.m FILE

#import "SettingsVC.h"

@interface SettingsVC ()

@end

@implementation SettingsVC

@synthesize mainStepper;

@end

ViewController.m FILE

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

@interface ViewController ()

@end

@implementation ViewController

-(void)here {
SettingsVC.mainStepper.value; //Property mainStepper not found on object of type 'SettingsVC'
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:23:22+00:00Added an answer on June 2, 2026 at 4:23 am

    I edited my answer, and this should make everything clear. You only create the UIStepper in one class, in this case SettingsVC. Then you can retrieve the variable through the property in other classes, just import SettingsVC.

    You need to create the property in SettingsVC.h

    #import <UIKit/UIKit.h>
    
    @interface SettingsVC : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate> {
    
    // Your other instance variables
    
    }
    
    @property (nonatomic, strong) UIStepper *mainStepper;
    
    @end
    

    You need to synthesize the property in SettingsVC.m

    #import "ViewController.h"
    #import "SettingsVC.h"
    
    @implementation SettingsVC
    
    @synthesize mainStepper;
    
    @end
    

    Let’s say you have a class named ViewController. You would access the value of the UIStepper like such:

    #import "ViewController.h"
    #import "SettingsVC.h"
    
    @implementation ViewController
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        SettingsVC *settingsVC = [[SettingsVC alloc] init];
        settingsVC.mainStepper.value = 23.0;
    
        NSLog(@"%f", settingsVC.mainStepper.value);
    }
    
    @end
    

    You will be using this in other classes, so you need to retain this property. You typically only use assign with primitive values such as a BOOL.

    @property (nonatomic, strong) UIStepper *mainStepper;
    

    Edit: ARC will will automatically release settingsVC for you, so never explicitly release.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been seeing code like this usually in the start of header files:
I am trying to save some files using C, with this code: sprintf(playerinput,%s,end); sprintf(fileloc,%s/.notend,getenv(HOME));
Sometimes I see header files of the form. #include <sys/sysinfo.h> // I found this
I've looked everywhere for this function and cannot find the header files to make
I have some external header files in a separate directory (its the sqlite3.h). I
Possible Duplicate: Should C++ eliminate header files? In languages like C# and Java there
Update: What are the effects of including stdafx.h in my header files? I started
I see @package a lot in Apple's header files, but for the life of
I was browsing through Windows's Platform SDK header files (what a life, right?), and
If I want to include directories to be searched for header files, which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.