IOS Questions

iphone Interview Questions part-5

41-Why an app on iOS device behaves differently when running in foreground than in background?

An application behaves differently when running in foreground than in background because of the limitation of resources on iOS devices.

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

43-Which framework delivers event to custom object when app is in foreground?

The UIKit infrastructure takes care of delivering events to custom objects. As an app developer, you have to override methods in the appropriate objects to process those events.

44-When an app is said to be in not running state?

An app is said to be in ‘not running’ state when: 
– it is not launched.
 
– it gets terminated by the system during running.

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

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

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

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

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

Background state.

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