Thursday 24 September 2015

Experienced iPhone Interview Questions and Answers

31. 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.

32. Who calls the main function of you app during the app launch cycle? 
During app launching, the system creates a main thread for the app and calls the app’s main function on that main thread. The Xcode project's default main function hands over control to the UIKit framework, which takes care of initializing the app before it is run.

33. Give example scenarios when an application goes into InActive state? 
An app can get into InActive state when the user locks the screen or the system prompts the user to respond to some event e.g. SMS message, incoming call etc.

34. When an app is said to be in active state? 
An app is said to be in active state when it is running in foreground and is receiving events.
Name the app sate which it reaches briefly on its way to being suspended.
An app enters background state briefly on its way to being suspended.

35. 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.

36. 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.

37. 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.

38. How is the app delegate is declared by Xcode project templates?
App delegate is declared as a subclass of UIResponder by Xcode project templates.

39. What happens if IApplication object does not handle an event?
In such case the event will be dispatched to your app delegate for processing.

40. Which app specific objects store the app's content?
Data model objects are app specific objects and store app’s content. Apps can also use document objects to manage some or all of their data model objects.

More Questions & Answers:-
Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8

No comments:

Post a Comment