Latest 2016 Interview questions for iOS. IICT is the No.1 iOS Training Institute in Chennai managed by real time iOS Experts who have vast experience in Mobile Application development Domain. IICT supports various real time projects. IICT develops various mobile apps in real time. Best interview questions are shared here for the welfare of students who are especially freshers in iOS Technology.
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.