So I’m trying to make the horrible leap from VB.NET to objective-C.
My only curly-brace experience is a little ActionScript 3… I’m having a hard time grasping the use of the * character.
Question 1:
The tutorial I’m using has these two lines next to each other..
IBOutlet UIPickerView *pickerView;
NSArray* myArray;
It’s my understanding that the * denotes essentially a reference type. Why does it precede the variable name on the first line, but the class name on the second?
Question two, about class declarations:
@implementation {
Why is some code here
}
and other code here?
@end
That’s a big can of worms – the answer is that the syntax there is equivalent, you can do whichever you like. Some people are pretty religious about one or the other, but the compiler doesn’t care.
I think you mean
@interface, right? The code inside the braces is just a list of instance variables. Outside the braces is where you put method declarations.If you want to learn Objective-C, it is probably well worth it to go and learn C first. Then when you understand the syntax and C concepts like pointers and forward declarations, you can pick up Objective-C pretty quickly.