Thursday, October 3, 2013

Memory Management in Objective C

In this topic, we will discuss Reference Counting and some other memory management topics related to Objective C.

Reference Counting


Reference Counting is a technique of storing a number of reference to an Object at any given state. As soon as the reference count goes to the Zero object is released from the memory. It is important from the development point of view of application where memory is critical and to maintain responsiveness. It is the most simple algorithm for memory management. 

Objective C provides two methods of Memory Management

  1. MRR - Manual Retain-Release: In this method, you explicitly keep track of the Objects you own. 
  2. ARC - Automatic Reference Counting uses the same algorithm of MRR, However, while using ARC Compiler insert appropriate statements in your code at compile time. 

Thursday, September 26, 2013

What's new in iOS 7?

iOS 7 Major release of iOS. It has come up with a lot of things for users and the developers. UI has been completely redesigned and also come with a new animation system for creating games. 

I will list what's new in iOS 7.

  • What's new in User Interface

    • UI Redesign - UI has been completely redesigning and throughout the system, the focus has been on the functionality and making sure that things are easier than before. Introduction of the Control Center, Navigation around the settings menus with the swipe, Updated Notification Center, Accessibility updates, and Siri has just become more helpful than before.  

Common Objective C coding errors

I am going to introduce the common coding errors made while programming in Objecive C language.

1. Declaring the const char * strings. Yes this the common coding error while programming, You almost never want to declare a const char * string, e.g. see the below line of code.



self.selectedLabel.text = [NSString stringWithFormat:@"Selected : %d", self.selectedCount];

Object Model of Objective C

Object Model of objective C is derived from SmallTalk. It has its basis in SmallTalk. Few things to know before understanding the Object Model.


What is Object?

Think of Object as a real world entity. What is a real world entity? It is something which have some data in its possession and perform different kind of functions. e.g. Think of a Tap as an object. It perform different kind of functions like start water flow, stop water flow, control the rate at which water should flow. Objects hold the data and the methods it perform.

Tuesday, September 24, 2013

IBAction and IBOutlet keywords




(IBAction)selectedCard:(UIButton *)sender {

IBAction is nothing but typedef void. Xcode puts this to keep track that this not a random method that returns void but an Action method that connects view to the controller.



@property (weak, nonatomic) IBOutlet UILabel *selecedLabel;

IBOutlet is typedef of void. Xcode puts this just to keep track that it not some random @property, but it is an Outlet i.e. connection to the view.