IOS - FIRST IPHONE APPLICATION

Similar documents
About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

Learn iphone and ipad game apps development using ios 6 SDK. Beginning. ios 6 Games. Development. Lucas Jordan. ClayWare Games tm

A product of Byte Works, Inc. Credits Programming Mike Westerfield. Art Karen Bennett. Documentation Mike Westerfield

ios Development Tutorial Nikhil Yadav CSE 40816/60816: Pervasive Health 09/09/2011

Send from your App Part 1

Tutorial: ios OData Application Development with REST Services. Sybase Unwired Platform 2.2 SP04

ios App Development for Everyone

Start Developing ios Apps Today

Your First ios Application

Tag Specification Document

2. Create the User Interface: Open ViewController.xib or MainStoryBoard.storyboard by double clicking it.

INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011

GETTING STARTED. AppSher In-App Analytics for ios

Creating a Custom Class in Xcode

Salesforce Mobile Push Notifications Implementation Guide

Application Programming on the Mac COSC346

Microsoft Tag Scanning SDK for iphone & Android Apps

Knappsack ios Build and Deployment Guide

How To Develop An App For Ios (Windows)

ios Dev Fest Research Network Operations Center Thursday, February 7, 13

MA-WA1920: Enterprise iphone and ipad Programming

Setup Guide. network support pc repairs web design graphic design Internet services spam filtering hosting sales programming

Praktikum Entwicklung von Mediensystemen mit

Development of Computer Graphics and Digital Image Processing on the iphone Luciano Fagundes

ios App for Mobile Website! Documentation!

ios App Development for Everyone

iphone Objective-C Exercises

SQL Server 2005: Report Builder

MTP: Continuous User Authentication on Android Using Face Recognition

Praktikum Entwicklung von Mediensystemen mit ios

Active Directory Integration for Greentree

Mobile App Design and Development

SharpdeskTM R3.1. Installation Guide Version

Introduction: The Xcode templates are not available in Cordova or above, so we'll use the previous version, for this recipe.

History Explorer. View and Export Logged Print Job Information WHITE PAPER

Oracle Fusion Middleware

M, N, O F, G, H. network request, 101 ParseFacebookUtilities SDK, 100 profile, 100 user_about_me, 101 -(void)updateindicator, 101

App Distribution Guide

Introduction to Android Development

Nintex Forms 2013 Help

TakeMySelfie ios App Documentation

Salesforce Mobile Push Notifications Implementation Guide

View Controller Programming Guide for ios

Downloading Driver Files

SAM Server Utility User s Guide

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Xcode Application note

Praktikum Entwicklung von Mediensystemen mit ios

Using an Edline Gradebook. EGP Teacher Guide

Eclipse installation, configuration and operation

Website Builder Overview

OUTLOOK WEB APP (OWA): MAIL

UOFL SHAREPOINT ADMINISTRATORS GUIDE

Quick Guide: ixpand Transfer

ICP Data Entry Module Training document. HHC Data Entry Module Training Document

Star Micronics Cloud Services ios SDK User's Manual

Introduction to iphone Development

ManageMyHealth SMS Text Message Service User Guide. Medtech32. Version 20.0 (March 2012)

Salesforce Classic Guide for iphone

3dCart Shopping Cart Software V3.X Affiliate Program Guide

Using WinSCP to Transfer Data with Florida SHOTS

How to install and use the File Sharing Outlook Plugin

Deploying Intellicus Portal on IBM WebSphere

To begin, visit this URL:

User Guide. support.keytime.co.uk

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

WA1781 WebSphere Process Server v6.2 Administration. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Creating Dashboards. Intellicus Enterprise Reporting and BI Platform. Intellicus Technologies

HTML Code Generator V 1.0 For Simatic IT Modules CP IT, IT, IT

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

LiveText for Salesforce Quick Start Guide

Using the UPSMON-Plus Monitoring Software

OBIEE : Browser and Operating System Compatibility. Including Known Issues and Solutions

ACHieve Access 4.3 User Guide for Corporate Customers

Technology Services Group Procedures. IH Anywhere guide. 0 P a g e

Installation instructions for MERLIN Dashboard

Appointment Scheduler

Step 2. Choose security level Step 2 of 3

The Coast to Coast AM Podcast for itunes 11

COMP327 Mobile Computing Session: Lecture Set 4 - Data Persistence, Core Data and Concurrency

CNC Transfer. Operating Manual

Microsoft Word Quick Reference Guide. Union Institute & University

Setup for WinPlus/picoPrompt automatic script transfer via a remote FTP site

1 Intel Smart Connect Technology Installation Guide:

Auto Print User s Manual

Detecting and Removing Spyware From Your Home Computer

The Rush 24/7 Podcast for itunes 11

edgebooks Quick Start Guide 4

Portability Study of Android and ios

Igotta, LLC Resource Reservation SharePoint 2013 Server App and SharePoint 2013 Online App Solution. Guide for Administrators

Active Interest Media File Transfer Server Initial Client Install Documentation

Desktop VirtualPBX Softphone Setup Instructions for Windows

Administering Jive for Outlook

CareAware Capacity Management - Patient Flow Patient List Gadget

Outlook Plugin. What is MangoApps for Outlook?

Posting Job Orders. mindscope Staffing and Recruiting Software

Pcounter Mobile Guide

Merging Labels, Letters, and Envelopes Word 2013

IBM BPM V8.5 Standard Consistent Document Managment

Sophos Mobile Control Super administrator guide. Product version: 3

Transcription:

IOS - FIRST IPHONE APPLICATION http://www.tutorialspoint.com/ios/ios_first_iphone_application.htm Copyright tutorialspoint.com Creating the First App Now we are going to create a simple single view application ablankapp that will run on the ios simulator. The steps are as follows. Step 1 Open Xcode and select Create a new Xcode project. Step 2 Select Single View Application. Step 3 Enter the product name, i.e., the name of the application, organization name, and then

the company identifier. Step 4 Ensure that Use Automatic Reference Counting is selected in order to automatically release the resources allocated once it goes out of scope. Click Next. Step 5 Select the directory for the project and select create. Step 6 You will see a screen as follows

In the screen above, you will be able to select the supported orientations, build and release settings. There is a field deployment target, the device version from which we want to support, lets select 4.3, which is the minimum deployment target allowed now. For now, these are not required and let's focus on running the application. Step 7 Now, select iphone simulator in the drop down near Run button and select run. Step 8 That's it; you have successfully run your first application. You will get an output as follows

Now let's change the background color, just to have a start with the interface builder. Select ViewController.xib. Select background option in the right side, change the color and run. In the above project, by default, the deployment target would have been set to ios 6.0 and autolayout will be enabled. To ensure that our application runs on devices that are on ios 4.3 onwards, we have already modified the deployment target at the start of creation of this application, but we didn't disable auto-layout. To disable auto-layout, we need to deselect the auto-layout checkbox in the file inspector of each nib, i.e., the xib files. The various sections of Xcode project IDE are given in the following figure Courtesy: AppleXcode4Userdocumentation. File inspector is found in the inspector selector bar as shown above and auto layout can be unchecked there. Auto layout can be used when you want to target only ios 6 devices. Also, you'll be able to use many new features like passbook if you raise the deployment target to ios 6. For now, let's stick to ios 4.3 as the deployment target. Code of the First ios Application You will find five different files that would have been generated for your application. They are

listed as follows AppDelegate.h AppDelegate.m ViewController.h ViewController.m ViewController.xib AppDelegate.h // Header File that provides all UI related items. #import <UIKit/UIKit.h> // Forward declaration (Used when class will be defined /imported in future) @class ViewController; // Interface for Appdelegate @ interface AppDelegate : UIResponder <UIApplicationDelegate> // Property window @property (strong, nonatomic) UIWindow *window; // Property Viewcontroller @ property (strong, nonatomic) ViewController * viewcontroller; //this marks end of interface AppDelegate inherits from UIResponder that handles ios events. Implements the delegate methods of UIApplicationDelegate, which provides key application events like finished launching, about to terminate and so on. UIWindow object to manage and co-ordinate the various views on the ios device screen. It's like the base view over which all other views are loaded. Generally there is only one window for an application. UIViewController to handle the screen flow. AppDelegate.m // Imports the class Appdelegate's interface import "AppDelegate.h" // Imports the viewcontroller to be loaded #import "ViewController.h" // Class definition starts here @implementation AppDelegate // Method to intimate us that the application launched successfully - (BOOL)application:(UIApplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions self.window = [[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; // Override point for customization after application launch. self.viewcontroller = [[ViewController alloc] initwithnibname:@"viewcontroller" bundle:nil]; self.window.rootviewcontroller = self.viewcontroller; [self.window makekeyandvisible]; return YES;

- (void)applicationwillresignactive:(uiapplication *)application /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationwillterminate: when the user quits.*/ - (void)applicationwillenterforeground:(uiapplication *)application /* Called as part of the transition from the background to the inactive state. Here you can undo many of the changes made on entering the background.*/ - (void)applicationdidbecomeactive:(uiapplication *)application /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.*/ - (void)applicationwillterminate:(uiapplication *)application /* Called when the application is about to terminate. Save data if appropriate. See also applicationdidenterbackground:. */ - (void)applicationwillterminate:(uiapplication *)application /* Called when the application is about to terminate. Save data if appropriate. See also applicationdidenterbackground:. */ UIApplication delegates are defined here. All the methods defined above are UI application delegates and contains no user defined methods. UIWindow object is allocated to hold the application allocated. UIViewController is allocated as the window's initial view controller. To make the window visible, makekeyandvisible method is called. ViewController.h #import <UIKit/UIKit.h> // Interface for class ViewController @interface ViewController : UIViewController The ViewController class inherits the UIViewController, which provides the fundamental view management model for the ios applications. ViewController.m

#import "ViewController.h" // Category, an extension of ViewController class @ interface ViewController () @implementation ViewController - (void)viewdidload [super viewdidload]; // Do any additional setup after loading the view, typically from a nib. - (void)didreceivememorywarning [super didreceivememorywarning]; // Dispose of any resources that can be recreated. Two methods implemented here are defined in the base class UIViewController. Do initial setup in viewdidload which is called after the view loads. didreceivememorywarning method is called in case of memory warning. Loading [MathJax]/jax/output/HTML-CSS/jax.js