I'm new to ios deveolpment, but have a little prior knowledge in programming .net 1.0/2.0.
Mij OOP skills are at beginner level still. I'm trying to learn to xcode using the book Objective-c for absolute beginners.
I struggle mainly with the syntax of objective-c. I'm learning class basics and ui basics.
An example from the book has me build an small app with just a label and a button. When the button is pressed, the label gets updated.
Now, in the viewcontroller.h file I define the following property:
How do I read that line. The type is UILabel, the name is *nameLabel, but what is IBOutlet and why does that need to come in front of the property?
Also, in the implementation file the label is set in the showName method
Why do I also need to link the label to the owner in the UI (xib file)?
Thanks for any answers!
EDIT:
I hope these beginners questions are okay here ...
Mij OOP skills are at beginner level still. I'm trying to learn to xcode using the book Objective-c for absolute beginners.
I struggle mainly with the syntax of objective-c. I'm learning class basics and ui basics.
An example from the book has me build an small app with just a label and a button. When the button is pressed, the label gets updated.
Now, in the viewcontroller.h file I define the following property:
Code:
@interface ViewController : UIViewController {
IBOutlet UILabel *nameLabel;
}
- (IBAction)showName:(id)sender;
How do I read that line. The type is UILabel, the name is *nameLabel, but what is IBOutlet and why does that need to come in front of the property?
Also, in the implementation file the label is set in the showName method
Code:
- (IBAction)showName:(id)sender{
[nameLabel setText:@"My name is ..."];
}
Why do I also need to link the label to the owner in the UI (xib file)?
Thanks for any answers!
EDIT:
I hope these beginners questions are okay here ...