Difference between iOS5 and iOS4?

Camera Service -
In iOS 4: Photos could only be taken by the Camera app, from the Home screen, with the slide-to-zoom technology. However, there were no exposure settings available and the photos could not be edited on the device itself.
In iOS 5: The camera icon is now found on the lock screen and the volume up button is used to take photos. Other features include pinch-to-zoom and tapping to set exposure. The photos can be edited on the device itself.
Web Navigation -
In iOS 4: Here you needed to tap the screen to fill the screen with text and no Read Later function was available. In addition, browsing was separated into pages or windows.
In iOS 5: The new Safari reader in iOS 5 fills the screen with the text in just one click. A new Reading List allows articles to be bookmarked for later use and browsing can now be done on separate tabs.
Game Center -
In iOS 4: The Game Center in iOS 4 allowed mobile-to-mobile gaming but there was a catch - the apps had to be purchased via the App Store.
In iOS 5: The improved Game Center in iOS 5 allows new social features such as sharing of scores, recommending friends and many more. The biggest advantage that Game Center in iOS 5 provides is that the apps can be purchased from within the Game Center.
Notifications -
In iOS 4: There were pop-up notifications in iOS 4, along with separate alerts for missed calls, text messages and voice mails, as also push notifications from apps. This, however, interrupted previously running videos or games.
In iOS 5: This time there is an improved Notification Center that combines all notifications, including voice mails, missed calls and text messages and even push notifications from apps. The notification list is found at the top of the screen and doesn't interrupt gaming or videos.
Emails -
In iOS 4: There were single keyboards with standard texts available and you had to type to add or change addresses. There was no option for message flagging and no dictionary.
In iOS 5: A dual-sided keyboard is now available, with rich-text formatting as well as click-and-drag addresses. You can now flag messages as unread and an in-built dictionary is available.
Twitter Integration -
In iOS 4: A standard Twitter app was available. However, you had to open it first in order to tweet stories or photos from the device.
In iOS 5: A new Twitter integration called the 'Tweet Sheet' is available and you can now share stories from within Safari and tweet photos directly from the camera app with a single click.
Access to News -
In iOS 4: Individual apps were required to gain access to the latest news. Each magazine or a newspaper required a separate app and had to be opened and read individually.
In iOS 5: A new Newsstand feature has been introduced with iOS 5 where several newspapers and magazine subscriptions are organized on a news stand that looks similar to the iBooks layout.
Connectivity -
In iOS 4: A PC or a laptop was needed for setting up, synchronizing or updating the device.
In iOS 5: A computer-less set up is now available where you can synchronize via iCloud and there are wireless software updates available as well.
Texting -
In iOS 4: Text messaging in iOS 4 was only accessible through the service provider.
In iOS 5: The new iMessage now allows device-to-device messaging which is similar to BlackBerry's BBM service.
Lists -                                                                                      
In iOS 4: The traditional notes app allowed you to make lists but there were no synchronization capability in the offering.
In iOS 5: The new Reminder app allows you to create to-do lists and you can also synchronize it with iCloud, iCal and Outlook.

What is Cocoa?

Cocoa is an application environment for both the Mac OS X operating system and iOS.  It consists of a suite of object-oriented software libraries, a runtime system, and an integrated development environment. Carbon is an alternative environment in Mac OS X, but it is a compatibility framework with procedural programmatic interfaces intended to support existing Mac OS X code bases.

Blocks in iPhone?

As a programmer, you’re used to data types like String, which is a variable type for text. We also are aware of things like int, float, and double, which are variable types to store numeric values. Finally, we know about things like NSObject, which is a foundation level class that allows us to bundle various collections of both data types and methods (a.k.a. functions). Blocks bring something significantly different to the table, providing a data type for executable code storage.
If that doesn’t make sense to you, don’t worry: blocks can be tough. Their purpose and function becomes much more clear upon seeing examples of their use. One of the most popular types of patterns in which blocks are used is for providing “completion blocks” to objects who perform some kind of asynchronous operation. The following is an example of a method signature provided in my UIView that takes advantage of accepting a completion block from a user:
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;
That final completion parameter there is a block. As with all Objective-C methods, the method has named parameters. The animations and completion parameter are the blocks. You can tell because of the ^ character. This character is used to define a block. While a block variable type holds executable code, the block type itself must be defined. Just like when writing code within a method, blocks can provide objects to the code which it holds. Here we see the animation block defined first:
animations:(void (^)(void))animations
We can see this block returns void and provides void. In this block you would change all the UIKit animatable properties you would want. The completion block is a bit different though.
completion:(void (^)(BOOL finished))completion
In this block we can still see that we will be returning void. However, this time our block will be returning the completion BOOL for us to utilize if we like. When actually implementing this method in Xcode, the IDE does a lot of the work to get you past the somewhat jarring syntax of blocks. Once tabbed over to the parameter input for a block when calling a method, in Xcode 4 and above, hit enter and Xcode will create the outline of the block for you.
Perviously, you might imagine providing this functionality through the delegate pattern, but blocks are here now to allow for greater flexibility and will only become more popular with future versions of the SDK.