IOS Interview Questions

IOS Interview Questions

  • What is the reuseIdentifier used for?

The reuseIdentifier is used to indicate that a cell can be re-used in a UITableView. For example when the cell looks the same, but has different content. The UITableView will maintain an internal cache of UITableViewCell’s with the reuseIdentifier and allow them to be re-used when dequeueReusableCellWithIdentifier: is called. By re-using table cell’s the scroll performance of the tableview is better because new views do not need to be created.

IOS Interview Questions

  • Explain the difference between atomic and nonatomic synthesized properties?

Atomic and non-atomic refers to whether the setters/getters for a property will atomically read and write values to the property. When the atomic keyword is used on a property, any access to it will be “synchronized”. Therefore a call to the getter will be guaranteed to return a valid value, however this does come with a small performance penalty. Hence in some situations nonatomic is used to provide faster access to a property, but there is a chance of a race condition causing the property to be nil under rare circumstances (when a value is being set from another thread and the old value was released from memory but the new value hasn’t yet been fully assigned to the location in memory for the property).

                                                                                                                                      IOS Interview Questions

  • Explain the difference between copy and retain?

Retaining an object means the retain count increases by one. This means the instance of the object will be kept in memory until it’s retain count drops to zero. The property will store a reference to this instance and will share the same instance with anyone else who retained it too. Copy means the object will be cloned with duplicate values. It is not shared with anyone else.

IOS Interview Questions

  • What is method swizzling in Objective C and why would you use it?

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.

                                                                                                                                  IOS Interview Questions

  • What’s the difference between not-running, inactive, active, background and suspended execution states?

Not running: The app has not been launched or was running but was terminated by the system.
Inactive: The app is running in the foreground but is currently not receiving events. (It may be executing other code though.) An app usually stays in this state only briefly as it transitions to a different state.
Active: The app is running in the foreground and is receiving events. This is the normal mode for foreground apps.
Background: The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended. However, an app that requests extra execution time may remain in this state for a period of time. In addition, an app being launched directly into the background enters this state instead of the inactive state.
Suspended: The app is in the background but is not executing code. The system moves apps to this state automatically and does not notify them before doing so. While suspended, an app remains in memory but does not execute any code. When a low-memory condition occurs, the system may purge suspended apps without notice to make more space for the foreground app.

IOS Interview Questions

  • What is a category and when is it used?

A category is a way of adding additional methods to a class without extending it. It is often used to add a collection of related methods. A common use case is to add additional methods to built in classes in the Cocoa frameworks. For example adding async download methods to the UIImage class.
                                                                                                                                    IOS Interview Questions

  • What JSON framework is supported by iOS (iPhone OS)?

SBJson framework is supported by iOS. It is a JSON parser and generator for Objective-C (Objective-C is the primary programming language you use when writing software for OS X and iOS. It’s a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime).
SBJson provides flexible APIs and additional control that makes JSON handling easy.

  • What is Responder Chain ?

A ResponderChain is a hierarchy of objects that have the opportunity to respond to events received.
IOS Interview Questions

  • What is Regular expressions ?

Regular expressions are special string patterns that describe how to search through a string.

  • What is Operator Overloading ?

Operator overloading allows us to change how existing operators behave with types that both already exist.

  • What is TVMLKit ?

TVMLKit is the glue between TVML, JavaScript, and your native tvOS application.

  • What is Platform limitations of tvOS ?

First, tvOS provides no browser support of any kind, nor is there any WebKit or other web-based rendering engine you can program against. This means your app can’t link out to a web browser for anything, including web links, OAuth, or social media sites.

Second, tvOS apps cannot explicitly use local storage. At product launch, the devices ship with either 32 GB or 64 GB of hard drive space, but apps are not permitted to write directly to the on-board storage.

tvOS app bundle cannot exceed 4 GB.

  • Why is design pattern very important ?

Design patterns are reusable solutions to common problems in software design. They’re templates designed to help you write code that’s easy to understand and reuse. Most common Cocoa design patterns:

Creational: Singleton.
Structural: Decorator, Adapter, Facade.
Behavioral: Observer, and, Memento

  • What is Realm benefits ?

An open-source database framework.
Implemented from scratch.
Zero copy object store.

  • Explain generics in Swift ?

Generics create code that does not get specific about underlying data types. Don’t catch this article.


This information box about the author only appears if the author has biographical information. Otherwise there is not author box shown. Follow YOOtheme on Twitter or read the blog.
+91 9952948899