*****************************Design Pattern*********************
- Creational: Singleton and Abstract Factory.
- Structural: MVC, Decorator, Adapter, Facade and Composite.
- Behavioral: Observer, Memento, Chain of Responsibility and Command.
MVC - model , view , controller
Singleton - one instance exists [UIApplication sharedApplication]
Facade Design - Facebook API
Decorator pattern- Decorator pattern dynamically adds behaviors and responsibilities to an object without modifying its code.implementations of this pattern: Category and Delegation.
category - Category is that allows you to add methods to existing classes without subclassing
Delegation - , Delegation, is a mechanism in which one object acts on behalf of, or in coordination with, another object
Observer pattern - one object notifies other objects of any state changes. e.g Notifications and Key-Value Observing
The memento pattern -The memento pattern captures and externalizes an object’s internal state. In other words, it saves your stuff somewhere. Memento pattern is Archiving. NSCoder class
*****************************Dynamic Typing*********************
Dynamic Typing:
Determining class of a Object at runtime is called dynamic typing.
Dynamic binding:
Determining the method to invoke at run time is called dynamic binding.
*****************************Obj c and c++*********************
Objective C Allows method name and variable name exactly the same.
-It doesn't have the constructor or destructor instead,it has init and dealloc which must be called explicitly.
-It uses '+' and '-' to differentiate factory and instance methods.
-It uses dynamic linking.
-It got categories .
Auto layout - IOS 6
store data - plist , nsuserdefault , sqlite, core data
Shallow copy is also known as address copy.
deep copy you copy data
What is advantage of categories? What is difference between implementing a category and inheritance?
You can add method to existing class even to that class whose source is not available to you. You can extend functionality of a class without subclassing. You can split implementation in multiple classes. While in Inheritance you subclass from parent class and extend its functionality.
polymorphism - Ability of base class pointer to call function from derived class at runtime is called polymorphism.at runtime, super class reference is pointing to whatever subclass,
App delegate is declared as a subclass of UIResponder
@interface - It’s a keyword used to declare the Class
@implementation - It’s a keyword used to define the Class
@synthesize - to generate getters and setters automatically from compiler
Atomic and non- atomic - nonatomic and atomic are related to multithreading environment . If a property has an attribute as “nonatomic” that means multiple threads can modify that property concurrently. If the attribute is “atomic”, the threads would be given access atomically. So “Atomic” is thread safe while “nonatomic” is thread unsafe.
@ dynamic - It tells compiler that getter and setter are not implemented by the class but by some other class. e.g The Managed object classes have properties defined by using @dynamic
mustitasking - IOS4
Json - Form iOS 5 Onwards we are using NSJSONSerialization inherited from NSObject Base class.
categories and extensions- Class extensions are similar to categories. The main difference is that with an extension, the compiler will expect you to implement the methods within your main @implementation, whereas with a category you have a separate @implementation block. So you should pretty much only use an extension at the top of your main .m file (the only place you should care about ivars, incidentally) — it’s meant to be just that, an extension.
KVC - KVC(Key Value Coding) Normally instance variables are accessed through properties or accessors but KVC gives another way to access variables in form of strings.In this way your class acts like a dictionary and your property name.
KVO (Key Value Observation): The mechanism through which objects are notified when there is change in any of property is called KVO.
A protocol, declared with the (@protocol syntax in Objective-C) is used the declare a set of methods that a class that “adopts” .id<MyProtocol> instanceOfClassThatImplementsMyProtocol;protocol Directives :- @optional, @required.
run loop - . A run loop is an event processing loop that you use to schedule work and coordinate the receipt of incoming events. The purpose of a run loop is to keep your thread busy when there is work to do and put your thread to sleep when there is none. Run loop management is not entirely automatic. You must still design your thread’s code to start the run loop at appropriate times and respond to incoming events.
No comments:
Post a Comment