Started developing iOS apps? Great ! Before that make sure you have familiar with basic concepts covered in this post. Most probably you started using, but totally unaware of it. All these topics are the checklist for your next interview or your presentation and also you are welcome even if use it as cheatsheet.
Again I want to stress that it covers only the topic definition or few lines of description. You can find good tutorial sites for rest of in depth explanation.
[1] App
A large ecosystem of interconnected objects that communicate with each other to solve specific problem such as displaying user interface, responding events, inputs and storing information.
[2] App ID
App id is a 2 part string used to identify one or more apps from a single development team. Combination of Team Id and Bundle ID separated by a period character(.) There are 2 types of App Id’s , an Explicit app id used for single app and wildcard app ids (with domain name *) used for set of apps.
[3] Apple ID
A unique apple account login id / user id (basically email id) that allows to access Apple store, iBooks etc.
[4] BundleID
A bundle ID precisely identifies a single app. A bundle ID is used during the development process to provision devices and by the operating system when the app is distributed to customers. For example, Game Centre and In-App Purchase use a bundle ID to identify your app when using these services. The bundle ID string must be a uniform type identifier (UTI) that contains only alphanumeric characters (A-Z,a-z,0-9), hyphen (-), and period (.). The string should be in reverse-DNS format.
[5] Objective – C
Primary programming language for writing app for OS X and iOS. Super set of C language.
[6] Dynamic programming language
Static typed languages are those in which type checking is done at compile-time, whereas dynamic typed languages are those in which type checking is done at run-time. Objective-C is a best example for dynamically-typed language, meaning that you don't have to tell the compiler what type of object you're working with at compile time.
[7] Class
Blueprint of object, A class is a data structure that can have methods, instance variables, and properties, along with many other features. A class must have super class. Except, NSObject and NSProxy classes, which are root classes. Root classes do not have a superclass.
[8] Object
Object is an instance of class. Will stored in heap (chunk of memory not in serial ordered) and accessed by using pointers.
[9] Immutable Object
It must set internal contents when it is created, and cannot subsequently be changed by other objects. Ex: NSString, NSNumber, NSDictionary, NSArray. Also are thread safe.
[10] Mutable Object
Object those contents are changing at runtime. Ex: NSMutableString, NSMutableDictionary.
NSMutableString subclasses from NSString
[11] Instance method
Prefix (-) for Instance method, Are accessed only after the class allocates and initialises its instance
[12] Class / factory / static method
Prefix (+) indicates Class method or Factory method or Static method. We can call static method without creating / using instance of that class.
[13] Subclassing
Overriding methods of existing class. UIButton, UITextField… are subclassed from UIView.
Eg : myHorizontalLine subclassed class from UIView by overriding method “-(void) drawRect:(CGRect) rect;”
[14] Cocoa and Cocoa Touch
“Cocoa” (OS X) = Foundation framework + Appkit
“Cocoa Touch” (iOS) = Foundation framework + UIKit [In iOS, Appkit replaced with UIKit]
[15] LLVM (Low Level Virtual Machine)
It is faster than GCC compiler. Built with optimised library system. Greatly works with IDE.
LLVM parser handles syntax highlighting , code completion and every other index driven features.
[16] Fast enumeration
Fast enumeration is a language feature that allows you to enumerate over the contents of a collection.
[15] Collection
Collection classes are like NSArray, NSDictionary, NSSet.
Use [NSNull null] or NSNil object to represent no object in collection.
[16] Sandbox
For security reasons, iOS restricts each application (including preferences and data) into unique location in the filesystem. This restriction is called Application’s sandbox. Each app has access to the contents of its own sandbox.
[17] Keychain
Is a secure, encrypted container for password data. Stored outside of application sandbox.
[18] Ad-Hoc Application
It allows pre-release copies of app. Way to get app review before release.
[19] Thread-Safe
Thread safe code can be safely called from multiple threads or concurrent tasks without causing any problems (data corruption, crashing, etc). Code that is not thread safe must only be run in one context at a time.
An example of thread safe code is NSArray. You can use it from multiple threads at the same time without issue. On the other hand, NSMutableArray is not thread safe and should only be accessed from one thread at a time.
[20] Context Switch
A context switch is the process of storing and restoring execution state (context) of a process or thread, when we switch between executing different threads on a single core (single process). So that the execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU and is an essential feature of a multitasking operating system. It’s like switching from one thread (process) to another.
[21] Notifications
NSNotification object provides a mechanism for broadcasting information. Async message passing b/w objects don’t know each other. They just know the broadcaster from which they have registered. (matches the key)
[22] Malloc
Creates a block of memory (which is not associated with any object).
[23] Free
System does not release Malloc based memory blocks. Hence used for releasing such blocks.
[24] Retain Counting
Retain counts are the way in which memory is managed in Objective-C. When you create an object, it has a retain count of 1. When you send an object a retain message, its retain count is incremented by 1. When you send an object a release message, its retain count is decremented by 1. When you send an object a autorelease message, its retain count is decremented by 1 at some stage in the future. If an objectʼs retain count is reduced to 0, it is deallocated.
[25] ARC Automatic Reference Counting
ARC is a compiler level feature that simplifies memory management of objective-c objects. Instead of you having to remember when to retain or release an object, ARC evaluates the lifetime requirements of your objects and automatically inserts the appropriate method calls at compile time. Makes sure every object is nil or points to an object (i.e. No memory leak and no dangling pointers).
[26] Plist
Property lists organise data into named values and lists of values using several object types. These types give you the means to produce data that is meaningfully structured, transportable, storable, and accessible, but still as efficient as possible. The property-list programming interfaces for Cocoa and Core Foundation allow you to convert hierarchically structured combinations of these basic types of objects to and from standard XML. You can save the XML data to disk and later use it to reconstruct the original objects.
[27] Launch Image
When an app is launched, the system displays a temporary image until the app is able to present its user interface. This temporary image is your app’s launch image and it provides the user with immediate feedback that your app is launching and will be ready soon. You must provide at least one launch image for your app and you may provide additional launch images to address specific scenarios.
[28] Responder Chain
When the event happens in a view, the view will fire the event to chain of UIResponder objects associated with the view. The first UIResponder object is UIView itself. If it does not handle the event, then it continues up the chain until UIResponder object handled this event. It included UIViewControllers, UIView’s parent views and their associated UIViewControllers. if none of these handles UIWindow is asked and at last UIApplicationDelegate.
[29] Chain of Responsibility
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
[30] Dangling Pointer
A pointer whose object has been destroyed. Solution : After de-allocating memory, initialise pointer to NULL so that pointer will be no longer dangling.
[31] Memory Leak
An object without pointer is useless, it is occupying memory. But not other object can event get, a reference to it. An object fails to go out of existence when no other objects exists that have a pointer to it. Possibly crashing with EXC_BAD_ACCESS error.
[32] Autorelease
When object sends ‘Autorelease’ message, that object is placed in autorelease pool, and a number is incremented saying how many times this object has been placed in this autorelease pool. From time to time, when nothing else is going on, the autorelease pool is automatically drained - This means that autorelease pool sends release message to each of its objects. Causes retain count zero and destroyed in the usual way.
So autorelease is a form of release; but with the policy “later, not right this second!”.
[33] Autorelease Pool
Autorelease pool blocks provide a mechanism whereby you can have ownership of an object, but avoid the possibility of it being deallocated immediately (such as when you return an object from a method). Autorelease pool instances are stored in pre-thread stack. Remember, each thread has its own stack of pools, which is used to determine which pool to put an object in when it gets autoreleased. It will create pool if not created (otherwise looks up current pool) and calls addObject:. Later when the pool is destroyed, release message sent to each objects from top to bottom of stack.
[34] Retain Cycle
Situation where 2 objects are each retaining another, Neither object’s retain count decremented to zero. Resulting in memory leak.
[35] Posing
Objective-C permits a class to replace with another class within a program. The replacing class is said to "pose as" the target class. NSObject contains the poseAsClass: method that enables us to replace the existing class as said above.
[36] Method swizzling
Method swizzling allows the implementation of an existing selector to be switched at runtime for a different implementation in a classes dispatch table. Swizzling allows you to write code that can be executed before and/or after the original method. For example perhaps to track the time method execution took, or to insert log statements