Practicing Objective-C in Xcode. I haven’t really been able to do much over the last week, having worked over 40 hours in 5 days, but I’ve been able to do a bit here and there. While the code shown is INCREDIBLY messy, it was just a quick test on how to use classes and instance methods in Obj-C.
Instance Methods are quite interesting, in that they differ from the way methods are called in C, C++, C#, or really any other language.
For example, a method call in C# (from within a class) would look like this…
myClassObject MyCustomClass = new MyCustomClass();
Whereas in Objective-C, it looks like this…
myClassObject *MyClass = [[MyClass alloc] init];
[myClassObject custom:parameter function:parameter];
So you can see why it’s a little bit tricky to get used to Objective-C. However, I’ve found that for some reason, I actually prefer Objective-C’s way of calling methods, it somehow makes it easier once you get used to it.