Latest iOS Interview Questions and Answers

Read Top iOS Interview Questions and Answers Experienced, Freshers for Job Interview Quiz with Solutions.

What are the delegate methods of MKMapView?

Firstly you have added the storeKit framework in your xcode project then define the protocol as in .h file.

– (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated;

– (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated;

– (void)mapViewWillStartLoadingMap:(MKMapView *)mapView;

– (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView;

– (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error;

– (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation;

– (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views;

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.

What is polymorphism?

This is very famous question and every interviewer asks this. Few people say polymorphism means multiple forms and they start giving example of draw function which is right to some extent but interviewer is looking for more detailed answer.

Ability of base class pointer to call function from derived class at runtime is called polymorphism.

Are document objects required for an application? What does they offer?

Document objects are not required but are very useful in grouping data that belongs in a single file or file package.

Which is the super class of all view controller objects?

UIViewController class. The functionality for loading views, presenting them, rotating them in response to device rotations, and several other standard system behaviors are provided by UIViewController class.

How can an operating system improve battery life while running an app?

An app is notified whenever the operating system moves the apps between foreground and background.  The operating system improves battery life while it bounds what your app can do in the background. This also improves the user experience with foreground app.

What are the features of iPhone 3gs?

Video: Videos can be edited, shared. High quality VGA video can be shot in portrait or landscape.

3 Mega pixel Camera: Still photos with greater quality can be taken

Voice control: It recognizes the names in contacts and recognizes the music on iPod.

Compass: iPhone 3GS has built-in digital compass, used to point the way.

Internet Tethering: Internet surfing can be done from anywhere. A 3G connection can be shared on Iphone3 with Mac notebook or laptop.

What is an iPhone app?

An iPhone app is a program that runs on our iPhone/iPod Touch. It enables us to complish a certain task. They could be utility apps, games, enterprise apps, entertainment apps, apps to access our bank account etc.

What is push notification?

Imagine, you are looking for a job. You go to software company daily and ask sir “is there any job for me” and they keep on saying no.  Your time and money is wasted on each trip.(Pull Request mechanism).

So, one day owner says, if there is any suitable job for you, I will let you know. In this mechanism, your time and money is not wasted. (Push Mechanism).

Assume that an app is not in foreground but is still executing code. In which state will it be in?

Background state.

An app is loaded into memory but is not executing any code. In which state will it be in?

An app is said to be in suspended state when it is still in memory but is not executing any code.

Which JSON framework is supported by iOS?

SBJson framework is supported by iOS.  It is a JSON parser and generator for Objective-C. SBJson provides flexible APIs and additional control that makes JSON handling easier.

How can you respond to state transitions on your app?

On state transitions can be responded to state changes in an appropriate way by calling corresponding methods on app’s delegate object.

For example:

applicationDidBecomeActive method can be used to prepare to run as the foreground app.

applicationDidEnterBackground method can be used to execute some code when app is running in the background and may be suspended at any time.

applicationWillEnterForeground method can be used to execute some code when your app is moving out of the background

applicationWillTerminate method is called when your app is being terminated.

List down app’s state transitions when it gets launched.

Before the launch of an app, it is said to be in not running state.

When an app is launched, it moves to the active or background state, after transitioning briefly through the inactive state.

What are the important delegate methods of NSXML parser?





What is Automatic Reference Counting (ARC) ?

ARC is a compiler-level feature that simplifies the process of managing the lifetimes 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.

What is the purpose of UIWindow object?

The presentation of one or more views on a screen is coordinated by UIWindow object.

Apart from incorporating views and controls, what else an app can incorporate?

Apart from incorporating views and controls, an app can also incorporate Core Animation layers into its view and control hierarchies.

Assume that system is running low on memory. What can system do for suspended apps?

In case system is running low on memory, the system may purge suspended apps without notice.

Which object is create by UIApplicationMain function at app launch time?

The app delegate object is created by UIApplicationMain function at app launch time. The app delegate object’s main job is to handle state transitions within the app.

How do you change the content of your app in order to change the views displayed in the corresponding window?

To change the content of your app, you use a view controller to change the views displayed in the corresponding window. Remember, window itself is never replaced.

Define view object.

Views along with controls are used to provide visual representation of the app content. View is an object that draws content in a designated rectangular area and it responds to events within that area.

What are the location services?

Applications such as Maps, camera and compass are allowed to use the information from cellular, Wi-Fi and Global Positioning System networks for determining the approximate locations.

The location is displayed on the screen, using a blue marker.

What is delegate?

Delegate is an object that handles the events happening on an object. To do that delegate has to follow a protocol specifying the task it is going to handle.

What is the use of controller object UIApplication?

Controller object UIApplication is used without subclassing to manage the application event loop. It coordinates other high-level app behaviors.

It works along with the app delegate object which contains app-level logic.

Assume that your app is running in the foreground but is currently not receiving events. In which sate it would be in?

An app will be in InActive state if it is running in the foreground but is currently not receiving events. An app stays in InActive state only briefly as it transitions to a different state.

Which object manage the presentation of app’s content on the screen?

View controller objects takes care of the presentation of app’s content on the screen. A view controller is used to manage a single view along with the collection of subviews. It makes its views visible by installing them in the app’s window.

How is the app delegate is declared by Xcode project templates?

App delegate is declared as a subclass of UIResponder by Xcode project templates.

What are the popular apps of iPhone?

Face book-Social networking

Doodle Buddy-drawing

Pandora Radio-radio on our iPhone

Yelp-restaurant reviews

What is difference between NSNotification and delegate?

Delegate is passing message from one object to other object. It is like one to one communication while nsnotification is like passing message to multiple objects at the same time. All other objects that have subscribed to that notification or acting observers to that notification can or can’t respond to that event. Notifications are easier but you can get into trouble by using those like bad architecture. Delegates are more frequently used and are used with help of protocols.

What’s the difference between frame and bounds?

The frame of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to the superview it is contained within. The bounds of a view is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0).


Popular posts from this blog

TOP Agile Testing Interview Questions and Answers

Latest Agile Testing Interview Questions and Answers

Most Asked ADO.NET Interview Questions and Answers