My Android Blog

To view my posts on Android you can visit my Android Blog

Search This Blog

Sunday, July 15, 2012

iOS Development - Main Components & App Lifecycle*

Here are some of the important points to note - randomly jotted as they seem to make sense to me when I an beginning iOS Development. 


I would think that this is a list of stuff that I would keep referring back to till I get a grip on the development. It also probably helps in carifying some of the terms used often by iOS developers.


  1. XCode creates an application object that sets the run loop (a run loop registers inputs sources and enables the delivery of input events to your app). Among other things.
  2. The call to UIApplicationMain creates an instance of the UIApplication class and an instance of the app delegate
  3. The call to UIApplicationMain also scans the app’s Info.plist file. The Info.plist file is a property list (that is, a structured list of key-value pairs) that contains information about the app such as its name and icon.
  4. The main job of the app delegate is to provide the window into which your app’s content is drawn. The app delegate can also perform some app configuration tasks before the app is displayed.
  5. In an iOS app, a window object provides a container for the app’s visible content, helps deliver events to app objects, and helps the app respond to changes in the device’s orientation. The window itself is invisible.
  6. The first responder is a dynamic placeholder that represents the object that should be the first to receive various events while the app is running. These events include editing-focus events (such as tapping a text field to bring up the keyboard), motion events (such as shaking the device), and action messages (such as the message a button sends when the user taps it), among others. 
  7.  A view controller is responsible for managing one scene, which represents one area of content. The content that you see in this area is defined in the view controller’s view.
  8. Xcode provides a library of objects that you can add to a storyboard file. Some of these are user interface elements that belong in a view, such as buttons and text fields; others are higher level objects, such as view controllers and gesture recognizers.
  9.  “Target-Action” mechanism is what ties an action on a UI element to the target that can act upon it. This is a Cocoa Touch Design pattern
  10.  Typically view-controller is the target
  11. A message (action) sent from the UI to the View controller modifies the object data (model) and then the View Controller updates the text displayed in the UI to reflect the change in the model.
  12. An outlet describes a connection between two objects. When you want an object (such as the view controller) to communicate with an object that it contains (such as the text field), you designate the contained object as an outlet. When the app runs, the outlet you create in Xcode is restored, which allows the objects to communicate with each other at runtime.
  13. The viewDidUnload method is supplied by the Xcode template you chose, and it’s implemented for you by the UIKit framework. A view controller calls viewDidUnload when it needs to unload the views that it contains, which makes this method the right place to set the view’s outlets to nil.
  14.  A delegate is an object that acts on the behalf of another object
  15.  A class extension allows you to declare a method that is private to the class
  16.  Garbage Collection: The @autoreleasepool statement supports the Automatic Reference Counting (ARC) system. ARC provides automatic object-lifetime management for your app, ensuring that objects remain in existence for as long as they're needed and no longer.
*All of this is from Apple documentation but put together so that it acts like a starter kit 


What is XCode?*


  1. Xcode is the engine that powers Apple’s integrated development environment (IDE) for Mac OS X and iOS. It is also an application that takes care of most project details from inception to deployment. It allows you to:

               Create and manage projects, including specifying platforms, target requirements, dependencies, and build configurations.
               Write source code in editors with features such as syntax coloring and automatic indenting.
               Navigate and search through the components of a project, including header files and documentation.
               Build the project.
               Debug the project locally, in iOS Simulator, or remotely, in a graphical source-level debugger.
It is tightly integrated with Cocoa and Cocoa Touch Frameworks creating a powerful and easy-to-use powerful set of tools for iOS and Mac OS development.
It contains XCode IDE, interface builder tool and Apple LLVM compiler fully integrated. It has the IOS simulator, instruments, iOS SDKs and more...


* All of this is from Apple documentation but put together so that it acts like a starter kit 

What is Cocoa?*



  1. Cocoa is an application environment for both the Mac OS X operating system and iOS, the operating system used on Multi-Touch devices such as iPhone, iPad, and iPod touch. It consists of a suite of object-oriented software libraries, a runtime system, and an integrated development environment.
  2. The various layers that constitute Cocoa are shown in the diagram: It is quite self-explanatory in terms of a over view. Do not want to get into details.
  • How Cocoa fits into iOS?

  • Here the point is that the Cocoa Touch along with UIKit are "Application Layer" elements for iOS that replace the Appkit of the Mac OS stack. 
  • Foundation library continues the be the same.They form the core frameworks that we will have to work with for iOS development.


  1. * All of this is from Apple documentation but put together so that it acts like a starter kit 

Objective C

As you must be aware by now, if you are interested in developing apps for iOS, the language used is Objective C.


Objective C is C along with many things added to it.

So, to distinguish between what is C and what is added as part of objective C, all the Objective C parts are in square brackets. Even @ signs indicate it is Objective C

Some of the other points to note are:
  1. It provides a Foundation Library: Over 100 files with things to manipulate strings etc.
  2. A White space insensitive language
  3. A case sensitive language
  4. Should compile before running it
  5. Uses LLVM compiler
  6. Main block exists in all apps including iphone, ipad apps
  7. dynamic typing is also supported 
  1. This list might grow as I discover more. 

    The next few postings would be theory - but theory that I usually consider as essential for strong fundamentals before one can start development


Monday, July 9, 2012

Tips on Mac Usage for Windows Users

Notes on Mac usage 



  1. Cut paste key board short cuts on Mac: Till 10.6 mac at least, there is no option to cut and past files and folders. You have to drag and drop or use the mv command at the "terminal".
  2. Page down and Page up: Fn key + up arrow = page up (in MS word and some other software) cmd key + up arrow = page up (In browser etc.) Fn key / cmd key + down arrow = page down.
  3. A new line in a cell in Excel: cmd + alt(Option) + Enter keys
  4. Delete an item from finder (equivalent of windows explorer) – cmd + backspace
  5. Forward delete like the way delete button works on a windows machine: fn + backspace in MS word but cmd + backspace otherwise
  6. To type in a new line within a cell in Excel (equivalent of alt + enter in windows) : cmd + alt + enter on mac. Even ctrl+alt+enter works
  7. To start eclipse from the terminal (equivalent of cmd prompt in windows), ./eclipse –clean –debug or what ever options you want to pass
  8. Switch between apps is just as in Windows: cmd + tab (->| key)
  9. Switch between windows in the same app: cmd + ` (the key ` is a tough guess I suppose)
  10. To Show the hidden files (. Files) in the Finder on mac: Using a simple Terminal command, you can work with all the files on your machine from the Finder. Open Terminal, type this command, and press Enter: 
    defaults write com.apple.Finder AppleShowAllFiles YES 

    To make the command take effect, you need to restart the Finder. One way to do this is to hold       down the Option key, then click and hold on the Finder icon in the Dock. When the contextual menu appears, select Relaunch and the Finder will restart.