iOS development introduction
Upcoming SlideShare
Loading in...5

iOS development introduction



iOS development introduction

iOS development introduction



Total Views
Views on SlideShare
Embed Views



1 Embed 3 3



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    iOS development introduction iOS development introduction Presentation Transcript

    • Introduction To iOS Application Development iOS Application Development
    • What is iOS ? What are the requirement to develop iOS application ? What is Objective C ? How to develop Simple iOS Application ?
    • What is iOS ? iOS which was previously called iPhone OS is a mobile operating system developed by Apple . Its first release was in 2007 which included iPhone and iPod Touch. iPad (1st Generation) was released in the April 2010 and iPad mini was released in November 2012 . iOS is derived from OS X, with which it shares the Darwin foundation.
    • Requirements Must have a mac . Xcode Xcode is Apple’s integrated development environment (IDE). Xcode includes a source editor, a graphical user interface editor, and many other features. iOS SDK .
    • Objective C The language used in iOS development is objective C. Its additions to C language and mostly based on Smalltalk, one of the first object-oriented programming languages. Objective-C is a simple language. Its syntax is small, unambiguous, and easy to learn . Class Instance. Instance Variable Method
    • Properties Categories Protocol
    • Class In objective C the file where the declaration of class is done is called the interface file and the file where the class is defined is called the implementation file. A simple interface file MyClass.h would look like the following. @interface MyClass : NSObject{ // class variable declared here } // class properties declared here // class methods and instance methods declared here @end
    • The implementation file MyClass.m would be like follows @implementation MyClass // class methods defined here @end
    • Instance Object creation is done as follows MyClass *objectName = [[MyClass alloc]init] ; Instance Variable Declaration @interface MyClass : NSObject{ // Instance variable declared here } // class properties declared here // class methods and instance methods declared here @end Instance Variables
    • Methods Instance Method Method is declared in objective C as follows -(returnType) methodName : (typeName) variable1 : (typeName)variable2; To call this method in the same class we use the following statement [self calculateAreaForRectangleWithLength:30 andBreadth:20];
    • Class method Class methods can be accessed directly without creating objects for the class. They don't have any objects associated with it. An example is shown below. +(void)simpleClassMethod; It can be accessed by using the class name [MyClass simpleClassMethod];
    • Properties
    • An object’s properties let other objects inspect or change its state. Accessor methods (getters and setters) are used as an abstraction for interacting with the object’s underlying data. @property (getter=isRunning, readonly) BOOL running; The goal of the @property directive is to make it easy to create and configure properties by automatically generating these accessor methods.
    • Protocol A protocol is a group of related properties and methods that can be implemented by any class. They are more flexible than a normal class interface, since they let you reuse a single API declaration in completely unrelated classes. Protocol Declaration @protocol StreetLegal <NSObject> - (void)signalStop; - (void)signalLeftTurn; - (void)signalRightTurn; @end
    • Protocol Adoption @interface Bicycle : NSObject <StreetLegal> @end @implementation // Implement class methods //Implement Protocol methods @end
    • Categories Categories are a way to split a single class definition into multiple files. Their goal is to ease the burden of maintaining large code bases by modularizing a class. Categories work just like normal class definitions in that they are composed of an interface and an implementation.
    • NSObject is the “root” object in Objective-C No direct access to instance variables so we write some get/set “instance methods” Instance methods (affect internal state of class) are preceded with a minus sign “Class methods” (higher level functions) are preceded with a plus sign e.g. create new class Points To Remember
    • alloc is equivalent to C++ new but it also zeros all variables init should be applied to an instance before use These are often combined in shorthand: ComputerScience* ituCompSci = [[ComputerScience alloc] init]; There is no garbage collection on the iPhone, so we should release all of our instance memory.