nighthawk454
nighthawk454

Reputation: 963

How to connect Interface Builder elements to Xcode variables?

I am extremely new to iPhone development and am trying to make a Tab Bar Application in Xcode.

My understanding is that it should work like this:

  1. Create Tab Bar Application
  2. Add variables to view (ie FirstViewController.h)
  3. Add element in Instance Builder
  4. Draw line from New Referencing Outlet to File's Owner, and the variable should pop up.

The last step is where I have a problem, when I make a line to File's Owner the only thing that shows up is 'view'. None of my variables show up there. Any thoughts?

Specifically, I'm trying to make a slider and a label that shows the slider's value on change. I know that to do this I will need a slider, label, and function to handle the ValueChanged event. I can create the variables and UI elements, but I can't seem to link them.

Upvotes: 3

Views: 2245

Answers (1)

highlycaffeinated
highlycaffeinated

Reputation: 19867

When you declare your variables in your interface, you need to declare them as (IBOutlet):

UILabel IBOutlet *myLabel;

The question and answers here have more information.

Upvotes: 4

Related Questions