Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

iOS Basic Development

Day 2 Objective C knowledge -MVC Pattern

Introduction about Objective C


Mix C with Smalltalk Message passing(defining method) Single inheritance, classes inherit for one and only one supper class Dynamic binding OPP Language

UIKit Framework

Data Types
NSArray NSMutableArray NSString NSDictionary NSMutableDictionary NSDate NSRange NSInteger,

OOP
Class: defines the grouping data and code the type of an object Instance: a specific allocation of a class Method a function that an knows how to perform Use self to access method, properties,. Use supper to access method, properties,. of parent class

OOP
Objective C syntax a Class

Class interface in header file (.h)

Class implementation (.m)

OOP Message Syntax


BOOL :Return type sendMailTo:First part of method name. sendMailTo withBody :Second part of method name. sendMailTo:withBody: :full method name or is called selector address :First argument body :Second argument.

OOP Instance method


Starts with a dash Normal methods you are used to Can access instances variables inside as if they were locals Can you send message to self and supper inside Example calling

OOP Class Method


Starts with a plus. Used for allocation, singleton, utilities Can not access instance variables inside Example calling syntax

OOP Instance variable

OOP Object Lifecycle

MVC

You might also like