Monday, 17 October 2011

iOS Architecture and its Layers


                                  iOS is derived from MacOS X,which it shares the Darwin foundation, and is a Unix operating system.
  
 iOS consist of four Abstract layers are 
  • Cocoa Touch

  • Media

  • Core Services

  • Core OS 


    Core OS

                      Core OS consist of  C API based on unix, not a object oriented. Core OS handles the following functionalities are OSX kerner,Mach 3.0, BSD, Sockets, Security,Power Management, KeyChain Access, Certificates, File System, Bonjour.

 Core Services 

                                   Core Services classes are Object Oriented.Core Services handles the following functionalities are Collections,Core Location, Address Book, Net Services, Networking, Threading, File Access, Preferences, SQLite, URL Utilities.

 Media

                    Media handles the following functionalities are Core Audio, OpenAL, Audio Mixing, Audio Recording, Video Playback, JPEG,PNG,TIFF, PDF, Quartz(2D), Core Animation, OpenGL ES.

   Cocoa Touch

                                      Cocoa Touch handles the following functionalities are Multie Picker-Touch, Core Motion, View Hierarchy, Localization, Alerts, WebView, Map Kit, Image Picker, Camera, Controls.


How to use UIPopOverController in iPad

             How to use UIPopOverController in iPad

UIPopOverController is used to show the Content as a popover, it is used in iPad to display a content temporarily. PopOver will be displayed over the existing UIView or UIButton or UIBarButton as a special type of window, Popover will remains visible until user touch outside the popover window or you dismiss programmatically.

Create TableViewController  for popover content
    UITableViewController  *tbView = [[UITableViewController alloc]initWithStyle:UITableViewStyleGrouped]; 
    tbView.delegate = self;

Create and show PopOverController :-
   UIPopoverController *listPopover = [[UIPopoverController alloc]initWithContentViewController:tbView];   //initialized with tableview controller
//displaying popover on top of UIView inherited classes
    [listPopover presentPopoverFromRect:CGRectMake(0, 0, 300, 300) inView:yourUIButtonObject permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];

//for dispalying popover in UIBarbuttonItem
    [listPopover presentPopoverFromBarButtonItem:yourBarbuttonItemObject 
                                  permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

Dismiss PopOverController :-
      [listPopover dismissPopoverAnimated:YES];   

Can set the popover content size in two methods
    1) popoverContentSize property
    2)setPopoverContentSize:animated: method  ( particularly effective when need to animate changes to     the popover’s size)

Note :-
  should handle the orientation carefully when your barbutton hidden.



Foundation Framework in iOS (iPhone/iPad)


Foundation Framework in iOS

                                Foundation framework defines base layer of the objective C classes.

 The goal of the Foundation framework is

     - Object creation and  deallocation

     - Supports Unicode strings, object persistence, and object distribution

     - Basic utility classes like NSData , NSDate , NSString etc.

     - OS independent to provide portability

NSObject is the base class for all classes in objective C. Foundation Framework classes functionalities are

  • Object creation and deallocation(NSAutoReleasePool)
  • Data storage(NSData,NSString)
  • Text and strings(NSCharacterSet,NSScanner)
  • Dates and times(NSDate, NSTimeZone, NSCalendar, NSLocale)
  • Application coordination and timing(NSNotification,NSNotificationCenter, NSNotificationQueue)\
  • Object distribution and persistence(NSPropertyListSerialization, NSCoder)
  • Operating-system services(NSThread,NSFileManager,NSProcessInfo)
  • URL loading system