SlideShare une entreprise Scribd logo
1  sur  22
-Hussain KMR Behestee
     Software Engineer
   The JAXARA IT Ltd.
           [Session-1]
Agendas
 iOS App Dev Basics
 Building Hello World App
 Application Architecture
 Application States
 Coding in Objective C
 Short Message Send
 Storyboarding
 Static Table View
iOS App Dev Basics
 Cocoa Touch Framework
 iOS SDK
 XCode
 Objective-C
 iTunes-Store/App Store
Setup
Go this URL for details
Building Hello World App
 Start XCode
 Choose Create New XCode
    Project                     Getting idea about
   Choose Tabbed Application      Templates
    and press Next                 Nib File, Interface Builder
   Enter Necessary Information  Simulator
    and press Next                 UI Objects
   Locate where to save and
    press Create. Your Project
    will be created.
   Now Press Run Button, The
    application will be run in
    simulator.
Application Architecture
                main


            App Delegate

                          View
                        Controller

         Main Window

           View Controller
             Screen view
Application Architecture
App          The app delegate is a custom object created at app launch time, usually by the
delegate     UIApplicationMain function. The primary job of this object is to handle state
             transitions within the app. For example, this object is responsible for launch-time
             initialization and handling transitions to and from the background. For information
             about how you use the app delegate to manage state transitions, see Managing
             App State Changes”
View         View controller objects manage the presentation of your app’ s content on screen. A
controller   view controller manages a single view and its collection of subviews. When presented,
             the view controller makes its views visible by installing them in the app’ s window.
             The UIViewController class is the base class for all view controller objects. It provides
             default functionality for loading views, presenting them, rotating them in response to
             device rotations, and several other standard system behaviors. UIKit and other
             frameworks define additional view controller classes to implement standard system
             interfaces such as the image picker , tab bar interface, and navigation interface.
UIWindow     A UIWindow object coordinates the presentation of one or more views on a screen.
             Most apps have only one window, which presents content on the main screen, but apps
             may have an additional window for content displayed on an external display .
             T o change the content of your app, you use a view controller to change the views
             displayed in the corresponding window. Y ou never replace the window itself .
             In addition to hosting views, windows work with the UIApplication object to deliver
             events to your views and view controllers.
Application Architecture
IDE - XCode
Another Hello World App
For walking step by step visit: Hello World App
Another Hello World App (Cont.)
Application States
           The app has not been launched or was running but was terminated by the
Not running
           system.
           The app is running in the foreground but is currently not receiving events.
Inactive   (It may be executing other code though.) An app usually stays in this state
           only briefly as it transitions to a different state.
           The app is running in the foreground and is receiving events. This is the
Active
           normal mode for foreground apps.
           The app is in the background and executing code. Most apps enter this state
           briefly on their way to being suspended. However, an app that requests extra
           execution time may remain in this state for a period of time. In addition, an
Background
           app being launched directly into the background enters this state instead of
           the inactive state. For information about how to execute code while in the
           background, see “Background Execution and Multitasking.”
              The app is in the background but is not executing code. The system moves
              apps to this state automatically and does not notify them before doing so.
Suspended     While suspended, an app remains in memory but does not execute any code.
              When a low-memory condition occurs, the system may purge suspended
              apps without notice to make more space for the foreground app.
Application States
 application:willFinishLaunchingWithOptions:This method is your app’ s first
  chance to execute code at launch time.
 application:didFinishLaunchingWithOptions:—This method allows you to
  perform any final initialization before your app is displayed to the user.
 applicationDidBecomeActive:—Lets your app know that it is about to become the
  foreground app. Use this method for any last minute preparation.
 applicationWillResignActive:—Lets you know that your app is transitioning away
  from being the foreground app. Use this method to put your app into a quiescent state.
 applicationDidEnterBackground:—Lets you know that your app is now running in
  the background and may be suspended at any time.
 applicationWillEnterForeground:—Lets you know that your app is moving out of
  the background and back into the foreground, but that it is not yet active.
 applicationWillTerminate:—Lets you know that your app is being terminated. This
  method is not called if your app is suspended.
Objective-C Basics
Objective-C Basics
 By default, these accessor methods are synthesized
  automatically for you by the compiler, so you don’t need to
  do anything other than declare the property using
  @property in the class interface.
   @property NSString *firstName;
   NSString *firstName = [somePerson firstName];
   [somePerson setFirstName:@"Johnny"];
 The method used to access the value (the getter method)
  has the same name as the property.
 The method used to set the value (the setter method) starts
  with the word “set” and then uses the capitalized property
  name.
Objective-C Basics
 If you don’t want to allow a property to be changed via
  a setter method
   @property (readonly) NSString *fullName;
 If you want to use a different name for an accessor
  method
   @property (getter=isFinished) BOOL finished;
 If you need to specify multiple attributes, simply
  include them as a comma-separated list
   @property (readonly, getter=isFinished) BOOL
    finished;
Objective-C Basics
 Available Attributes are
    readwrite - Indicates that the property should be treated as read/write. This is
       default.
     readonly - Indicates that the property is read-only
     strong - Specifies that there is a strong (owning) relationship to the destination object
     weak - Specifies that there is a weak (non-owning) relationship to the destination
      object.
     copy - Specifies that a copy of the object should be used for assignment.
     assign - Specifies that the setter uses simple assignment. This is default.
     retain - Specifies that retain should be invoked on the object upon assignment.
     nonatomic - Specifies that accessors are nonatomic. By default, accessors are atomic
 How to use:
    In Interface @property(copy, readwrite) NSString *value;
    In Implement @synthesize value; or
          @synthesize value=@“somevalue”;
Blocks - Anonymous Function
•   Blocks are objects that encapsulate a unit of work—that is, a segment of
    code—that can be executed at any time.
•   A caret (^) is used as a syntactic marker for blocks.
Short Message Send
 Syntax
    [receiver message]
 Example
    [myRectangle display];
    [myRectangle setWidth:20.0];
    [myRectangle setOriginX: 30.0 y: 50.0];
 When the Params are optional
    [receiver makeGroup:group, memberOne, memberTwo,
     memberThree];
 Nested messaging
    [myRectangle setPrimaryColor:[otherRect primaryColor]];
 Message chaining
    x = [[[person address] street] name];
Storyboarding
Step by step Storyboarding
Using View Controllers in Storyboarding Application
Static Table View
 In the Attributes inspector, choose Static Cells in the
  Content pop-up menu.

Contenu connexe

Tendances

View groups containers
View groups containersView groups containers
View groups containers
Mani Selvaraj
 
Refreshing Your App in iOS 7
Refreshing Your App in iOS 7Refreshing Your App in iOS 7
Refreshing Your App in iOS 7
Aviary
 
Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
Brian Sam-Bodden
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
Ahsanul Karim
 

Tendances (20)

Day seven
Day sevenDay seven
Day seven
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android application
 
View groups containers
View groups containersView groups containers
View groups containers
 
AngularJS - dependency injection
AngularJS - dependency injectionAngularJS - dependency injection
AngularJS - dependency injection
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory Management
 
Android application-component
Android application-componentAndroid application-component
Android application-component
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
 
Building maintainable app
Building maintainable appBuilding maintainable app
Building maintainable app
 
Refreshing Your App in iOS 7
Refreshing Your App in iOS 7Refreshing Your App in iOS 7
Refreshing Your App in iOS 7
 
Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
 
Android tutorial (2)
Android tutorial (2)Android tutorial (2)
Android tutorial (2)
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Advance RCP
Advance RCPAdvance RCP
Advance RCP
 
Dependency Injection pattern in Angular
Dependency Injection pattern in AngularDependency Injection pattern in Angular
Dependency Injection pattern in Angular
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2
 

En vedette (8)

iOS 5
iOS 5iOS 5
iOS 5
 
iOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTechiOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTech
 
iOS - development
iOS - developmentiOS - development
iOS - development
 
iOS5 NewStuff
iOS5 NewStuffiOS5 NewStuff
iOS5 NewStuff
 
Fwt ios 5
Fwt ios 5Fwt ios 5
Fwt ios 5
 
iOS 5 Tech Talk World Tour 2011 draft001
iOS 5 Tech Talk World Tour 2011 draft001iOS 5 Tech Talk World Tour 2011 draft001
iOS 5 Tech Talk World Tour 2011 draft001
 
What Apple's iOS 5 Means for Marketers
What Apple's iOS 5 Means for MarketersWhat Apple's iOS 5 Means for Marketers
What Apple's iOS 5 Means for Marketers
 
iOS PPT
iOS PPTiOS PPT
iOS PPT
 

Similaire à iOS app dev Training - Session1

Similaire à iOS app dev Training - Session1 (20)

Compose Camp by GDSC NSUT
Compose Camp by GDSC NSUTCompose Camp by GDSC NSUT
Compose Camp by GDSC NSUT
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptx
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Introduction to State Restoration in Flutter
Introduction to State Restoration in FlutterIntroduction to State Restoration in Flutter
Introduction to State Restoration in Flutter
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Kotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKotlin for Android App Development Presentation
Kotlin for Android App Development Presentation
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.ppt
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
 
Ios development 2
Ios development 2Ios development 2
Ios development 2
 
Simple React Todo List
Simple React Todo ListSimple React Todo List
Simple React Todo List
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
 
Architecting Single Activity Applications (With or Without Fragments)
Architecting Single Activity Applications (With or Without Fragments)Architecting Single Activity Applications (With or Without Fragments)
Architecting Single Activity Applications (With or Without Fragments)
 
iOS Beginners Lesson 2
iOS Beginners Lesson 2iOS Beginners Lesson 2
iOS Beginners Lesson 2
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
GITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React Native
 
Android by Swecha
Android by SwechaAndroid by Swecha
Android by Swecha
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Android architecture
Android architecture Android architecture
Android architecture
 
Reactotron - A Debugging Agent
Reactotron -  A Debugging AgentReactotron -  A Debugging Agent
Reactotron - A Debugging Agent
 

Plus de Hussain Behestee (7)

Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Android session-5-sajib
Android session-5-sajibAndroid session-5-sajib
Android session-5-sajib
 
Android session 3-behestee
Android session 3-behesteeAndroid session 3-behestee
Android session 3-behestee
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
 
Android session 4-behestee
Android session 4-behesteeAndroid session 4-behestee
Android session 4-behestee
 
iOS Training Session-3
iOS Training Session-3iOS Training Session-3
iOS Training Session-3
 
iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
 

Dernier

VADODARA CALL GIRL AVAILABLE 7568201473 call me
VADODARA CALL GIRL AVAILABLE 7568201473 call meVADODARA CALL GIRL AVAILABLE 7568201473 call me
VADODARA CALL GIRL AVAILABLE 7568201473 call me
shivanisharma5244
 
Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...
Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...
Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...
makhmalhalaaay
 
Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...
Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...
Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...
Amil Baba Naveed Bangali
 
Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...
Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...
Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...
Amil Baba Naveed Bangali
 
Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...
Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...
Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...
baharayali
 
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
baharayali
 
Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...
Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...
Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...
baharayali
 
Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...
Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...
Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...
baharayali
 

Dernier (20)

VADODARA CALL GIRL AVAILABLE 7568201473 call me
VADODARA CALL GIRL AVAILABLE 7568201473 call meVADODARA CALL GIRL AVAILABLE 7568201473 call me
VADODARA CALL GIRL AVAILABLE 7568201473 call me
 
Legends of the Light v2.pdf xxxxxxxxxxxxx
Legends of the Light v2.pdf xxxxxxxxxxxxxLegends of the Light v2.pdf xxxxxxxxxxxxx
Legends of the Light v2.pdf xxxxxxxxxxxxx
 
Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...
Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...
Professional Amil baba, Kala jadu specialist in Multan and Kala ilam speciali...
 
Peaceful Meditation | Peaceful Way by Kabastro
Peaceful Meditation | Peaceful Way by KabastroPeaceful Meditation | Peaceful Way by Kabastro
Peaceful Meditation | Peaceful Way by Kabastro
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
From The Heart v8.pdf xxxxxxxxxxxxxxxxxxx
From The Heart v8.pdf xxxxxxxxxxxxxxxxxxxFrom The Heart v8.pdf xxxxxxxxxxxxxxxxxxx
From The Heart v8.pdf xxxxxxxxxxxxxxxxxxx
 
Jude: The Acts of the Apostates (Jude vv.1-4).pptx
Jude: The Acts of the Apostates (Jude vv.1-4).pptxJude: The Acts of the Apostates (Jude vv.1-4).pptx
Jude: The Acts of the Apostates (Jude vv.1-4).pptx
 
Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...
Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...
Best Astrologer Vashikaran Specialist in Germany and France Black Magic Exper...
 
Amil baba in Lahore /Amil baba in Karachi /Amil baba in Pakistan
Amil baba in Lahore /Amil baba in Karachi /Amil baba in PakistanAmil baba in Lahore /Amil baba in Karachi /Amil baba in Pakistan
Amil baba in Lahore /Amil baba in Karachi /Amil baba in Pakistan
 
Genesis 1:5 - Meditate the Scripture Daily bit by bit
Genesis 1:5 - Meditate the Scripture Daily bit by bitGenesis 1:5 - Meditate the Scripture Daily bit by bit
Genesis 1:5 - Meditate the Scripture Daily bit by bit
 
Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...
Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...
Top 10 Amil baba list Famous Amil baba In Pakistan Amil baba Kala jadu in Raw...
 
Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...
Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...
Famous Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil baba ...
 
Human Design Gates Cheat Sheet | Kabastro.com
Human Design Gates Cheat Sheet | Kabastro.comHuman Design Gates Cheat Sheet | Kabastro.com
Human Design Gates Cheat Sheet | Kabastro.com
 
St John's Church Parish Diary for May 2024
St John's Church Parish Diary for May 2024St John's Church Parish Diary for May 2024
St John's Church Parish Diary for May 2024
 
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
Top Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist in S...
 
MEIDUNIDADE COM JESUS PALESTRA ESPIRITA1.pptx
MEIDUNIDADE COM JESUS  PALESTRA ESPIRITA1.pptxMEIDUNIDADE COM JESUS  PALESTRA ESPIRITA1.pptx
MEIDUNIDADE COM JESUS PALESTRA ESPIRITA1.pptx
 
Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...
Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...
Famous Kala Jadu, Kala ilam specialist in USA and Bangali Amil baba in Saudi ...
 
Genesis 1:7 || Meditate the Scripture daily verse by verse
Genesis 1:7  ||  Meditate the Scripture daily verse by verseGenesis 1:7  ||  Meditate the Scripture daily verse by verse
Genesis 1:7 || Meditate the Scripture daily verse by verse
 
Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...
Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...
Famous Kala Jadu, Black magic expert in UK and Kala ilam expert in Saudi Arab...
 
"The Magnificent Surah Rahman: PDF Version"
"The Magnificent Surah Rahman: PDF Version""The Magnificent Surah Rahman: PDF Version"
"The Magnificent Surah Rahman: PDF Version"
 

iOS app dev Training - Session1

  • 1.
  • 2. -Hussain KMR Behestee Software Engineer The JAXARA IT Ltd. [Session-1]
  • 3. Agendas  iOS App Dev Basics  Building Hello World App  Application Architecture  Application States  Coding in Objective C  Short Message Send  Storyboarding  Static Table View
  • 4. iOS App Dev Basics  Cocoa Touch Framework  iOS SDK  XCode  Objective-C  iTunes-Store/App Store
  • 5. Setup Go this URL for details
  • 6. Building Hello World App  Start XCode  Choose Create New XCode Project  Getting idea about  Choose Tabbed Application  Templates and press Next  Nib File, Interface Builder  Enter Necessary Information  Simulator and press Next  UI Objects  Locate where to save and press Create. Your Project will be created.  Now Press Run Button, The application will be run in simulator.
  • 7. Application Architecture main App Delegate View Controller Main Window View Controller Screen view
  • 8. Application Architecture App The app delegate is a custom object created at app launch time, usually by the delegate UIApplicationMain function. The primary job of this object is to handle state transitions within the app. For example, this object is responsible for launch-time initialization and handling transitions to and from the background. For information about how you use the app delegate to manage state transitions, see Managing App State Changes” View View controller objects manage the presentation of your app’ s content on screen. A controller view controller manages a single view and its collection of subviews. When presented, the view controller makes its views visible by installing them in the app’ s window. The UIViewController class is the base class for all view controller objects. It provides default functionality for loading views, presenting them, rotating them in response to device rotations, and several other standard system behaviors. UIKit and other frameworks define additional view controller classes to implement standard system interfaces such as the image picker , tab bar interface, and navigation interface. UIWindow A UIWindow object coordinates the presentation of one or more views on a screen. Most apps have only one window, which presents content on the main screen, but apps may have an additional window for content displayed on an external display . T o change the content of your app, you use a view controller to change the views displayed in the corresponding window. Y ou never replace the window itself . In addition to hosting views, windows work with the UIApplication object to deliver events to your views and view controllers.
  • 11. Another Hello World App For walking step by step visit: Hello World App
  • 12. Another Hello World App (Cont.)
  • 13. Application States The app has not been launched or was running but was terminated by the Not running system. The app is running in the foreground but is currently not receiving events. Inactive (It may be executing other code though.) An app usually stays in this state only briefly as it transitions to a different state. The app is running in the foreground and is receiving events. This is the Active normal mode for foreground apps. The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended. However, an app that requests extra execution time may remain in this state for a period of time. In addition, an Background app being launched directly into the background enters this state instead of the inactive state. For information about how to execute code while in the background, see “Background Execution and Multitasking.” The app is in the background but is not executing code. The system moves apps to this state automatically and does not notify them before doing so. Suspended While suspended, an app remains in memory but does not execute any code. When a low-memory condition occurs, the system may purge suspended apps without notice to make more space for the foreground app.
  • 14. Application States  application:willFinishLaunchingWithOptions:This method is your app’ s first chance to execute code at launch time.  application:didFinishLaunchingWithOptions:—This method allows you to perform any final initialization before your app is displayed to the user.  applicationDidBecomeActive:—Lets your app know that it is about to become the foreground app. Use this method for any last minute preparation.  applicationWillResignActive:—Lets you know that your app is transitioning away from being the foreground app. Use this method to put your app into a quiescent state.  applicationDidEnterBackground:—Lets you know that your app is now running in the background and may be suspended at any time.  applicationWillEnterForeground:—Lets you know that your app is moving out of the background and back into the foreground, but that it is not yet active.  applicationWillTerminate:—Lets you know that your app is being terminated. This method is not called if your app is suspended.
  • 16. Objective-C Basics  By default, these accessor methods are synthesized automatically for you by the compiler, so you don’t need to do anything other than declare the property using @property in the class interface.  @property NSString *firstName;  NSString *firstName = [somePerson firstName];  [somePerson setFirstName:@"Johnny"];  The method used to access the value (the getter method) has the same name as the property.  The method used to set the value (the setter method) starts with the word “set” and then uses the capitalized property name.
  • 17. Objective-C Basics  If you don’t want to allow a property to be changed via a setter method  @property (readonly) NSString *fullName;  If you want to use a different name for an accessor method  @property (getter=isFinished) BOOL finished;  If you need to specify multiple attributes, simply include them as a comma-separated list  @property (readonly, getter=isFinished) BOOL finished;
  • 18. Objective-C Basics  Available Attributes are  readwrite - Indicates that the property should be treated as read/write. This is default.  readonly - Indicates that the property is read-only  strong - Specifies that there is a strong (owning) relationship to the destination object  weak - Specifies that there is a weak (non-owning) relationship to the destination object.  copy - Specifies that a copy of the object should be used for assignment.  assign - Specifies that the setter uses simple assignment. This is default.  retain - Specifies that retain should be invoked on the object upon assignment.  nonatomic - Specifies that accessors are nonatomic. By default, accessors are atomic  How to use:  In Interface @property(copy, readwrite) NSString *value;  In Implement @synthesize value; or  @synthesize value=@“somevalue”;
  • 19. Blocks - Anonymous Function • Blocks are objects that encapsulate a unit of work—that is, a segment of code—that can be executed at any time. • A caret (^) is used as a syntactic marker for blocks.
  • 20. Short Message Send  Syntax  [receiver message]  Example  [myRectangle display];  [myRectangle setWidth:20.0];  [myRectangle setOriginX: 30.0 y: 50.0];  When the Params are optional  [receiver makeGroup:group, memberOne, memberTwo, memberThree];  Nested messaging  [myRectangle setPrimaryColor:[otherRect primaryColor]];  Message chaining  x = [[[person address] street] name];
  • 21. Storyboarding Step by step Storyboarding Using View Controllers in Storyboarding Application
  • 22. Static Table View  In the Attributes inspector, choose Static Cells in the Content pop-up menu.