SlideShare uma empresa Scribd logo
1 de 6
iOS InterviewQuestionsand Answers
Topics
 DevelopmentBasics
 App Statesand Multitasking
 App States
 CoreApp Objects
DevelopmentBasics
Q1. WherecanyoutestApple iPhoneapps ifyou don’thave thedevice?
A. iOS Simulator canbe usedtotestmobile applications. Xcodetool that comesalong with iOS SDK includes XcodeIDE as
wellas the iOS Simulator. Xcodealsoincludes all requiredtools andframeworks for building iOS apps. However, it is
strongly recommendedto testthe appon the realdevice before publishing it.
Q2. DoesiOS supportmultitasking?
A. iOS 4 andabove supports multi-tasking andallows appsto remainin the background until they arelaunchedagainoruntil
theyareterminated.
Q3. WhichJSON frameworkis supportedbyiOS?
A. SBJsonframework is supportedby iOS. It is a JSONparserandgeneratorfor Objective-C. SBJsonprovides flexible APIs
andadditional control that makesJSON handling easier.
Q4. Whatare thetools requiredtodevelop iOS applications?
A. iOS development requires Intel-basedMacintoshcomputerandiOS SDK.
Q5. Name theframework that is usedtoconstructapplication’s userinterfaceforiOS.
A. TheUIKit framework is usedto developapplication’s userinterface for iOS. UIKit framework provides eventhandling,
drawingmodel, windows, views, andcontrols specifically designedfor a touchscreeninterface.
Q6. Name theapplication threadfromwhereUIKitclassesshould beused?
A. UIKit classesshouldbe usedonly from anapplication’s main thread. Note:The derivedclassesofUIResponder andthe
classeswhichmanipulate application’s userinterface should be usedfrom application’s main thread.
Q7. WhichAPIis usedtowritetestscriptsthathelp in exercisingthe application's userinterfaceelements?
A. UIAutomation APIis usedto automate testprocedures.Tests scripts arewritten in JavaScriptto the UIAutomation API.
This in turn simulates userinteraction with the application andreturns log information to the hostcomputer.
App Statesand Multitasking
Q8. Whyan app on iOSdevicebehavesdifferentlywhenrunningin foregroundthan in background?
A. Anapplication behavesdifferently whenrunning in foreground thanin backgroundbecauseofthe limitation ofresources
oniOS devices.
Q9. How canan operatingsystemimprove batterylife while runningan app?
A. Anappis notified wheneverthe operating systemmoves the apps betweenforeground andbackground. The operating
systemimproves battery life while itbounds whatyour appcandoin the background. This alsoimproves the userexperience
with foreground app.
Q10. Whichframework deliverseventto customobject whenapp is in foreground?
A. TheUIKit infrastructure takescareofdelivering events tocustom objects. As anappdeveloper, you haveto override
methods in the appropriate objects to processthose events.
App States
Q11. Whenan app is said to bein not runningstate?
A. Anappis saidto be in'not running' state when:
-it is not launched.
-it gets terminated bythe system during running.
Q12. Assume that yourapp is runningin theforegroundbutis currentlynotreceivingevents. Inwhich sateit would
bein?
A. Anappwill be in InActive state ifit is running in the foreground butis currentlynot receivingevents. Anappstaysin
InActive state only briefly asit transitions toa different state.
Q13. Give example scenarioswhenan application goesinto InActivestate?
A. Anappcangetinto InActive state whenthe userlocks the screenorthe system prompts the userto respondtosome event
e.g. SMS message,incoming calletc.
Q14. Whenan app is said to bein active state?
A. Anappis saidto be inactive state whenit is running in foreground andis receivingevents.
Q15. Name theapp sate which itreachesbrieflyon its waytobeingsuspended.
A. Anappenters backgroundstate briefly on its wayto beingsuspended.
Q16. Assume that an app is notin foregroundbutis still executingcode.In whichstate will it bein?
A. Backgroundstate.
Q17. An app is loaded into memory butis notexecutinganycode. Inwhich state will it bein?
A. Anappis saidto be insuspendedstate whenit is still in memory but is not executinganycode.
Q18. Assume that systemis runninglow on memory. Whatcan systemdoforsuspendedapps?
A. Incasesystemis running low on memory, the systemmay purge suspendedapps without notice.
Q19. How canyou respondtostatetransitions on yourapp?
A. Onstate transitions canberespondedto statechangesin anappropriate wayby callingcorresponding methods onapp's
delegateobject.
Forexample:
applicationDidBecomeActive method canbe usedto prepareto runasthe foreground app.
applicationDidEnterBackground method canbeusedto executesomecode whenappis running in the backgroundandmay
be suspendedatanytime.
applicationWillEnterForeground method canbe usedtoexecutesome codewhenyour appis moving out ofthe background
applicationWillTerminate method is calledwhenyour appis beingterminated.
Q20. List down app's statetransitions whenit getslaunched.
A. Before the launchofanapp, it is saidto bein not running state.
Whenanappis launched, it moves to the active orbackgroundstate, after transitioning briefly through the inactive state.
Q21. Whocalls themain function ofyou app duringthe app launch cycle?
A. During applaunching, the systemcreatesamain threadfor the appandcalls the app’s mainfunction onthatmain thread.
TheXcode project's default main function hands overcontrol to the UIKit framework, whichtakescareofinitializing the app
before itis run.
CoreApp Objects
Q22. Whatis theuse ofcontrollerobjectUIApplication?
A. Controller objectUIApplication is usedwithout subclassingto managethe application eventloop.
It coordinates otherhigh-level appbehaviors.
It works alongwith the appdelegateobject whichcontains app-levellogic.
Q23. Whichobjectis createbyUIApplicationMain functionat app launchtime?
A. Theappdelegateobject is createdbyUIApplicationMain function atapplaunchtime. The appdelegate object's mainjob
is to handle state transitions within the app.
Q24. How is the app delegateis declaredbyXcodeprojecttemplates?
A. Appdelegate is declaredasa subclassofUIResponderbyXcode projecttemplates.
Q25. WhathappensifIApplication objectdoesnot handlean event?
A. Insuchcasethe eventwill bedispatchedto yourappdelegatefor processing.
Q26. Whichapp specificobjects storethe app's content?
A. Datamodel objects areappspecific objects andstore app’scontent. Apps canalsouse documentobjects to managesome
orall oftheir datamodel objects.
Q27. Aredocumentobjects requiredforan application? Whatdoestheyoffer?
A. Documentobjects are notrequired butare veryuseful ingrouping data thatbelongs ina single file orfile package.
Q28. Whichobjectmanage thepresentationofapp's contenton thescreen?
A. View controller objects takescareofthe presentation ofapp's contenton the screen.Aview controller is usedto manage a
single view alongwith the collection of subviews. It makesits views visible byinstalling them in the app’s window.
Q29. Whichis the superclassof all view controllerobjects?
A. UIViewController class.Thefunctionality for loading views, presenting them, rotating them inresponse todevice
rotations, andseveralother standardsystem behaviors areprovided byUIViewController class.
Q30. Whatis thepurposeofUIWindow object?
A. Thepresentation ofone ormore viewson ascreenis coordinated byUIWindow object.
Q31. How doyou changethe contentofyour app in ordertochangethe views displayed in the correspondingwindow?
A. Tochangethe contentof yourapp, you usea view controller to changethe views displayedin the correspondingwindow.
Remember, window itself is neverreplaced.
Q32. Defineview object.
A. Views alongwith controls areusedtoprovide visual representationofthe appcontent. View is anobjectthat draws
contentin a designatedrectangularareaandit responds to eventswithin that area.
Q33. You wish todefine your customview. Whichclass will be subclassed?
A. Custom viewscanbedefined by subclassingUIView.
Q34. Apartfromincorporatingviews and controls, whatelsean app can incorporate?
A. Apartfrom incorporating views andcontrols, anappcanalsoincorporate Core Animation layers into its view andcontrol
hierarchies.
Q35. Whatarelayer objects and whatdotheyrepresent?
A. Layerobjects aredata objects whichrepresentvisual content. Layerobjects areusedbyviews to rendertheir content.
Custom layerobjects canalsobe addedtothe interface toimplement complex animations andothertypes ofsophisticated
visual effects.

Mais conteúdo relacionado

Destaque

Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Ivano Malavolta
 
Starting Core Animation
Starting Core AnimationStarting Core Animation
Starting Core AnimationJohn Wilker
 
Creating Container View Controllers
Creating Container View ControllersCreating Container View Controllers
Creating Container View ControllersBob McCune
 
Core Animation
Core AnimationCore Animation
Core AnimationBob McCune
 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBob McCune
 
Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV FoundationChris Adamson
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV FoundationBob McCune
 
Composing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationComposing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationBob McCune
 
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOSMake School
 
Core Graphics & Core Animation
Core Graphics & Core AnimationCore Graphics & Core Animation
Core Graphics & Core AnimationAndreas Blick
 
Objective-C for Java Developers
Objective-C for Java DevelopersObjective-C for Java Developers
Objective-C for Java DevelopersBob McCune
 

Destaque (13)

Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Starting Core Animation
Starting Core AnimationStarting Core Animation
Starting Core Animation
 
Creating Container View Controllers
Creating Container View ControllersCreating Container View Controllers
Creating Container View Controllers
 
Core Animation
Core AnimationCore Animation
Core Animation
 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngine
 
Mastering Media with AV Foundation
Mastering Media with AV FoundationMastering Media with AV Foundation
Mastering Media with AV Foundation
 
Master Video with AV Foundation
Master Video with AV FoundationMaster Video with AV Foundation
Master Video with AV Foundation
 
Composing and Editing Media with AV Foundation
Composing and Editing Media with AV FoundationComposing and Editing Media with AV Foundation
Composing and Editing Media with AV Foundation
 
Animation in iOS
Animation in iOSAnimation in iOS
Animation in iOS
 
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOS
 
Core Graphics & Core Animation
Core Graphics & Core AnimationCore Graphics & Core Animation
Core Graphics & Core Animation
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 
Objective-C for Java Developers
Objective-C for Java DevelopersObjective-C for Java Developers
Objective-C for Java Developers
 

Último

Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 

Último (20)

Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 

iOS interview questions and answers

  • 1. iOS InterviewQuestionsand Answers Topics  DevelopmentBasics  App Statesand Multitasking  App States  CoreApp Objects DevelopmentBasics Q1. WherecanyoutestApple iPhoneapps ifyou don’thave thedevice? A. iOS Simulator canbe usedtotestmobile applications. Xcodetool that comesalong with iOS SDK includes XcodeIDE as wellas the iOS Simulator. Xcodealsoincludes all requiredtools andframeworks for building iOS apps. However, it is strongly recommendedto testthe appon the realdevice before publishing it. Q2. DoesiOS supportmultitasking? A. iOS 4 andabove supports multi-tasking andallows appsto remainin the background until they arelaunchedagainoruntil theyareterminated. Q3. WhichJSON frameworkis supportedbyiOS? A. SBJsonframework is supportedby iOS. It is a JSONparserandgeneratorfor Objective-C. SBJsonprovides flexible APIs andadditional control that makesJSON handling easier. Q4. Whatare thetools requiredtodevelop iOS applications? A. iOS development requires Intel-basedMacintoshcomputerandiOS SDK. Q5. Name theframework that is usedtoconstructapplication’s userinterfaceforiOS. A. TheUIKit framework is usedto developapplication’s userinterface for iOS. UIKit framework provides eventhandling, drawingmodel, windows, views, andcontrols specifically designedfor a touchscreeninterface.
  • 2. Q6. Name theapplication threadfromwhereUIKitclassesshould beused? A. UIKit classesshouldbe usedonly from anapplication’s main thread. Note:The derivedclassesofUIResponder andthe classeswhichmanipulate application’s userinterface should be usedfrom application’s main thread. Q7. WhichAPIis usedtowritetestscriptsthathelp in exercisingthe application's userinterfaceelements? A. UIAutomation APIis usedto automate testprocedures.Tests scripts arewritten in JavaScriptto the UIAutomation API. This in turn simulates userinteraction with the application andreturns log information to the hostcomputer. App Statesand Multitasking Q8. Whyan app on iOSdevicebehavesdifferentlywhenrunningin foregroundthan in background? A. Anapplication behavesdifferently whenrunning in foreground thanin backgroundbecauseofthe limitation ofresources oniOS devices. Q9. How canan operatingsystemimprove batterylife while runningan app? A. Anappis notified wheneverthe operating systemmoves the apps betweenforeground andbackground. The operating systemimproves battery life while itbounds whatyour appcandoin the background. This alsoimproves the userexperience with foreground app. Q10. Whichframework deliverseventto customobject whenapp is in foreground? A. TheUIKit infrastructure takescareofdelivering events tocustom objects. As anappdeveloper, you haveto override methods in the appropriate objects to processthose events. App States Q11. Whenan app is said to bein not runningstate? A. Anappis saidto be in'not running' state when: -it is not launched. -it gets terminated bythe system during running. Q12. Assume that yourapp is runningin theforegroundbutis currentlynotreceivingevents. Inwhich sateit would bein? A. Anappwill be in InActive state ifit is running in the foreground butis currentlynot receivingevents. Anappstaysin InActive state only briefly asit transitions toa different state.
  • 3. Q13. Give example scenarioswhenan application goesinto InActivestate? A. Anappcangetinto InActive state whenthe userlocks the screenorthe system prompts the userto respondtosome event e.g. SMS message,incoming calletc. Q14. Whenan app is said to bein active state? A. Anappis saidto be inactive state whenit is running in foreground andis receivingevents. Q15. Name theapp sate which itreachesbrieflyon its waytobeingsuspended. A. Anappenters backgroundstate briefly on its wayto beingsuspended. Q16. Assume that an app is notin foregroundbutis still executingcode.In whichstate will it bein? A. Backgroundstate. Q17. An app is loaded into memory butis notexecutinganycode. Inwhich state will it bein? A. Anappis saidto be insuspendedstate whenit is still in memory but is not executinganycode. Q18. Assume that systemis runninglow on memory. Whatcan systemdoforsuspendedapps? A. Incasesystemis running low on memory, the systemmay purge suspendedapps without notice. Q19. How canyou respondtostatetransitions on yourapp? A. Onstate transitions canberespondedto statechangesin anappropriate wayby callingcorresponding methods onapp's delegateobject. Forexample: applicationDidBecomeActive method canbe usedto prepareto runasthe foreground app. applicationDidEnterBackground method canbeusedto executesomecode whenappis running in the backgroundandmay
  • 4. be suspendedatanytime. applicationWillEnterForeground method canbe usedtoexecutesome codewhenyour appis moving out ofthe background applicationWillTerminate method is calledwhenyour appis beingterminated. Q20. List down app's statetransitions whenit getslaunched. A. Before the launchofanapp, it is saidto bein not running state. Whenanappis launched, it moves to the active orbackgroundstate, after transitioning briefly through the inactive state. Q21. Whocalls themain function ofyou app duringthe app launch cycle? A. During applaunching, the systemcreatesamain threadfor the appandcalls the app’s mainfunction onthatmain thread. TheXcode project's default main function hands overcontrol to the UIKit framework, whichtakescareofinitializing the app before itis run. CoreApp Objects Q22. Whatis theuse ofcontrollerobjectUIApplication? A. Controller objectUIApplication is usedwithout subclassingto managethe application eventloop. It coordinates otherhigh-level appbehaviors. It works alongwith the appdelegateobject whichcontains app-levellogic. Q23. Whichobjectis createbyUIApplicationMain functionat app launchtime? A. Theappdelegateobject is createdbyUIApplicationMain function atapplaunchtime. The appdelegate object's mainjob is to handle state transitions within the app. Q24. How is the app delegateis declaredbyXcodeprojecttemplates? A. Appdelegate is declaredasa subclassofUIResponderbyXcode projecttemplates. Q25. WhathappensifIApplication objectdoesnot handlean event?
  • 5. A. Insuchcasethe eventwill bedispatchedto yourappdelegatefor processing. Q26. Whichapp specificobjects storethe app's content? A. Datamodel objects areappspecific objects andstore app’scontent. Apps canalsouse documentobjects to managesome orall oftheir datamodel objects. Q27. Aredocumentobjects requiredforan application? Whatdoestheyoffer? A. Documentobjects are notrequired butare veryuseful ingrouping data thatbelongs ina single file orfile package. Q28. Whichobjectmanage thepresentationofapp's contenton thescreen? A. View controller objects takescareofthe presentation ofapp's contenton the screen.Aview controller is usedto manage a single view alongwith the collection of subviews. It makesits views visible byinstalling them in the app’s window. Q29. Whichis the superclassof all view controllerobjects? A. UIViewController class.Thefunctionality for loading views, presenting them, rotating them inresponse todevice rotations, andseveralother standardsystem behaviors areprovided byUIViewController class. Q30. Whatis thepurposeofUIWindow object? A. Thepresentation ofone ormore viewson ascreenis coordinated byUIWindow object. Q31. How doyou changethe contentofyour app in ordertochangethe views displayed in the correspondingwindow? A. Tochangethe contentof yourapp, you usea view controller to changethe views displayedin the correspondingwindow. Remember, window itself is neverreplaced. Q32. Defineview object.
  • 6. A. Views alongwith controls areusedtoprovide visual representationofthe appcontent. View is anobjectthat draws contentin a designatedrectangularareaandit responds to eventswithin that area. Q33. You wish todefine your customview. Whichclass will be subclassed? A. Custom viewscanbedefined by subclassingUIView. Q34. Apartfromincorporatingviews and controls, whatelsean app can incorporate? A. Apartfrom incorporating views andcontrols, anappcanalsoincorporate Core Animation layers into its view andcontrol hierarchies. Q35. Whatarelayer objects and whatdotheyrepresent? A. Layerobjects aredata objects whichrepresentvisual content. Layerobjects areusedbyviews to rendertheir content. Custom layerobjects canalsobe addedtothe interface toimplement complex animations andothertypes ofsophisticated visual effects.