I, Keaton Brant, am proud to announce that I have finally finished a project that I have been working on for months. It’s been a tough road, I’ve had to devote many hours a day just to ponder the hugeness of this task, but I have finally done it. Yes, I have done what many have tried and failed to do, I have made a “Hello World” app in Xcode!
The scope of this accomplishment is admittedly tiny, but it seriously did take me months of on and off work to figure enough of Xcode out to start writing basic apps. I’m used to coding in REALbasic, a language where you, very simply, drag objects into a window and then write code that tells them what to do. Now, with Xcode, it’s trying to be more than that. It’s trying to make it so every app you write is skin-able, extensible, scriptable, objective, efficient, low-memory, customizable, integrated, 100% secure, and use as little code as possible. Well, all that sounds great, the downside is, to accomplish that, you have to worry less about what your app actually does, and more about all of those things. What if I want to make some stupid little app that plays fart noises? I don’t need all of that, I don’t want to worry about all of that. Sure, professional developers love that stuff, so good, give them the option of using all of these insane concepts so that the app is all of those things. For me, the guy who writes the silly little fart app, let me write like 2 lines of code, drag a button in, and be done with it.
Let me try to sum up some of the stuff I would have to do to make my silly little fart app (and, since I’m still really baffled, I might get some of this wrong). First, I’d have to create a new project from a list of like a jillion different templates that are totally baffling on their own. Then, assuming I chose the right template, I would have to open up the nib file in a new program, Interface Builder, and drag a button in. Then, back in Xcode, I’d have to create a new view controller class, complete with it’s own header file, which I would have to modify to include all of the details for any global variables, methods, and properties I want my code to have. Then, back in interface builder, I would have to import my new class and link it up to the window. Then, I’d have to link up my button, along with any other user elements, to my class so that my class knows they exist. If I were to add another interface element, I’d have to go back to my code, change the header file, then reload it in interface builder and link it up. If I were to have a text field or table or something, I’d have to define my class as a text field or table delegate, which allows it to include some new methods (which you have to look up in the crazy documentation, which I’ll get to later) that are called by that object once it’s I link its delegate property to my class.
Now I can finally get to coding. I want to make the fart noise loop over and over again. But I’m new at this, let me open up the documentation to see what the proper syntax for ‘for loops’ is. Hmm, I searched for ‘for loops’ and it’s telling me how to use emacs to edit my code, that’s not what I wanted. After searching around through the docs manually, I finally figured out for loops are called enumerations in xcode, but unfortunately, the word enumeration seems to mean like 5 different things, so it takes me another 10 minutes to find an article about the type of enumeration I’m looking for. Unfortunately, the article might as well have been written in iambic pentameter, because half of the words were other concepts and methods I didn’t understand. That’s where my 2 different books and 6 hours of video tutorials come in, I have to manually search the index through all of them, but still no luck. Google isn’t much better. So I am still stuck with only a vague knowledge of how to make basic loops.
Now, let’s assume I managed to get all of that worked out, which I still actually have not. I could go to compile, and find I have errors in my code. No biggie, let’s just see what it says and fix it really quick. Unfortunately, Xcode’s error messages are essentially useless, all you can really gain from them is “There’s something wrong around this area”. Usually ‘undefined function declaration’ or something along those lines does not mean you forgot to declare the function, rather, you forgot a semi-colon (which, as an aside, is completely unnecessary in most cases, the enter key will do fine for me) or a closing brace.
I could also go on and on about the syntax of the code. I still do not understand in what situations you can use dot notation (‘object.method(parameters);’) to call a function and in what situations you need to use square brackets (‘[object method:parameters];’). I don’t know why you have to put an asterisks in front of variable names for some types of variables, but not others. I find the fact that you have to synthesize all of the properties of a class annoying and pointless for most users. I don’t know in what situations you have to use alloc and which you don’t.
The bottom line is, it’s ridiculously confusing. I think anybody who has written an app in Xcode should be given 100 IQ points. And that’s my rant, I kinda doubt anybody will actually have read this far, so I can say whatever I want… hmm… WATCH IEYE!