Wednesday, July 18, 2012

iOS post 1

In my educational land, there was the massive beast of a library called DotNet and then now, there is a new creature that appeared.

I've taken the initiative to check out GHUnit, OCUnit and OCMock.

All of which I think is paramount to get any form of iOS going.

Infact, for work, we need to get it going for DotNet too but I will let that take shape whenever that is possible.

From this point forward for this article, I will be just be pasting article snips found all over the internet to assist my learning and also to compile my own library of tutorials. 
ViewController.xib (XIB file for short) is the interface layout file. You visually create/design the screen that’s displayed on the iPhone device using this file.
ViewController.m is the interface controller class. The interface layout file is linked to this class. This happens automatically, so at this stage you don’t need to think about it other than to know that any objects or events you set up in your interface class can be linked to your interface layout very easily. This is the file that will contain the Objective-C code you’re about to create.
ViewController.h is the interface controller class header file, where you’ll declare the instance variables, as well as the objects and events that you need to access from the interface screen.
The IBOutlet keyword means that quote_text is an object that can be linked to an interface element on the XIB file so that the view controller can access (or change) properties of the interface element. In this case, we’ll be setting the displayed text for the UITextView control but we could just as easily change the color, font, size, etc.
The IBAction keyword indicates that quote_btn_touch is an action that can be linked to an event for a UI control on the screen. In this case, we will be connecting to the quote button touched event.
In case you’re wondering, id means “any object that derives from NSObject”. Usually when you set up callbacks that buttons and other controls will call, they pass whatever button/control is sending the callback as the first parameter. Since we don’t necessarily know what type it is, we put id here.
 

Excerpts from here