2. Install Xcode
Join the iPhone Developer Program
Download the lastest version of the iOS (5)
SDK along with the latest version of Xcode
from https://developer.apple.com/
In
this case, the version of Xcode 4.2
which includes iOS sdk 5.0
5. Double click on downloaded Xcode Package to
start the installation.
Install Xcode on your computer
6. Aftersuccessfully installed Xcode and
iphone SDK.
Launch Xcode from
/Developer/Application/Xcode
Running Xcode on your computer
7. Steps
Choose File > New > New Project.
Select the project template for your
iOS or Mac OS X product, and click
Next.
Enter the product name and other
project details, and click Next.
Specify the project’s location in your
file system, and click Create.
Creating a new Project
12. Specify the project’s location in your file system,
and click Create.
Navigate to a place where you
want to keep your project
Save as ,the name of the project
Click Save
Optional GIT
Source Control if
required check the
box
15. The Application Life Cycleapplicationthe cycle
The
constitutes
life
sequence of events that
occurs between the
launch and termination
of your application.In
iOS, the user launches
your application by
tapping its icon on the
Home screen. Shortly
after the tap occurs, the
system displays some
transitional graphics
and proceeds to launch
your application by
calling its main function.
From this point on, the
bulk of the initialization
work is handed over to
UIKit, which loads the
application’s user
interface and readies its
event loop.
This diagram shows the sequence of events that occur from the time the application starts up to the
time it quits. At key points in the application’s life, UIKit sends messages to the application delegate
object to let it know what is happening. During the event loop, UIKit dispatches events to your
application’s custom event handlers.
16.
The Application Delegate
Monitoring the high-level behavior of your application is the
responsibility of the application delegate object, which is a custom
object that you provide.
Delegation is a mechanism used to avoid subclassing complex
UIKit objects, such as the default UIApplication object. Instead of
subclassing and overriding methods, you use the complex object
unmodified and put your custom code inside the delegate object.
As interesting events occur, the complex object sends messages
to your delegate object.
We can use these “hooks” to execute your custom code and
implement the behavior you need.
The application delegate object is responsible for handling
several critical system messages and must be present in every
iOS application.
The object can be an instance of any class you like, as long as it
17. App States
Not running State: The app has not been launched or was running but was terminated
by the system.
Inactive state: The app is running in the foreground but is currently not receiving events.
(It may be executing other code though.) An app usually stays in this state only briefly as
it transitions to a different state. The only time it stays inactive for any period of time is
when the user locks the screen or the system prompts the user to respond to some event,
such as an incoming phone call or SMS message.
Active state: The app is running in the foreground and is receiving events. This is the
normal mode for foreground apps.
Background state: 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 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.”
Suspended state: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. While
suspended, an app remains in memory but does not execute any code. When a low-
Applications running in iOS 4 and latersystemin one purge suspendedstates at any given time. make
memory condition occurs, the can be may of several different apps without notice to
more space for the foreground app.
20. 1. The system detects an incoming
phone call or SMS message, or a
calendar event occurs.
2. The system calls your application
delegate’sapplicationWillResignActive:
method. The system
also disables the delivery of touch
events to your application.
3. The system displays an alert panel
with information about the event. The
user can choose to ignore the event or
respond to it.
4. If the user ignores the event, the
system calls your application delegate’s
applicationDidBecomeActive: method
and resumes the delivery of touch
events to your application.
5. If the user responds to the event
instead of ignoring it, the system calls
your application delegate’s
applicationDidEnterBackground: method.
Your application should move to the
background as usual, saving any user
data or contextual information needed to
restore your application to its current
state later.
Handling application interruptions
22. The pattern defines not only the roles objects play
in the application, it defines the way objects
communicate with each other.
MVC is central to a good design for a Cocoa
application.
Model-View-Controller
23. View controllers are a vital link between an app’s
data and its visual appearance. Whenever an iOS app
displays a user interface, the displayed content is
managed by a view controller or a group of view
controllers coordinating with each other. Therefore,
view controllers provide the skeletal framework on
which you build your apps.
iOS provides many built-in view controller classes
to support standard user interface pieces, such as
navigation and tab bars. As part of developing an app,
you also implement one or more custom controllers to
display the content specific to your app.
About View Controllers
24.
25. view objects are the main way your application interacts with the user,
they have many responsibilities.Here are just a few:
Layout and subview management.
Drawing and animation
Event handling
About Views