• After more than 15 years covering everything Apple, it’s with a heavy heart we announce that we will no longer be publishing new content on iMore and the iMore forums will be closing as of November 1st, 2024.

New to OOP and in need of clarification!

ostricide

New member
Nov 7, 2010
1
0
0
Visit site
I am new to OOP and have a only vague understanding of C. I am trying to learn from the iTunes U videos but have stumbled upon a sticking point:

regarding IBAction and IBOutlet, from a controller objects point of view, which does what? (In my old school mind these are like BASIC's peek (an address) and poke (an address) is this wrong?)

I am trying to recreate the slider demonstration where a label displays the sliders value but my version of xCode is not like in the demo and I am confused about how to wire the objects and which IB objects to use.

So I create a new project called test, goto the testViewController.xib which opens Interface Builder and I drag over a slider and label... I then goto xCode and under File > New File... > Object C Object (call it "updater") and goto the updater.h file. Here I define IBOutlets and an IBAction for the slider and the label...

@interface updater : NSObject {

IBOutlet UISlider* theSlider;
IBOutlet UILabel* theLabel;
int sliderVal;

}

- (IBAction) updateLabel : (UILabel *) theLabel;

@end

now when I goto IB and try to connect the outlets and actions to the files owner the only thing available is -View. I expect to see an outlet or an action.

What am I doing wrong?

Thanks for taking the time to help me out! :)
 

Latest posts

Trending Posts

Members online

Forum statistics

Threads
262,087
Messages
1,774,044
Members
441,393
Latest member
sunnyville01