Thursday, February 11, 2010

iPhone Interview Technical Questions

Q1) Where do you save users settings? Ex. User is in Chicago, appln is showing chicago weather, and users selects New York as its locations. Users quits the application & starts again, he should be shown New York.

Ans) NSUserDefault, NSDictionary; both this can persist the users value, even after appln is closed.


Q2) What sought of XMLParser you have used in our project?

Ans) NSXmlParser.


Q3) Have you used libXml?

Ans) LibXml is an XML parser. Current version is libxml2.2. LibXml2 is the best way to parse XML files.

Following are the steps involved in using the LibXml2 library.

Step1) Add the reference of the Framework in the project. LibXml2 file is located at

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libxml2.2.dylib

Step2) Add the reference to Header file for compiling; for this navigate to Xcode --> Project --> Edit Project Settings

under project settings navigate to "Search Paths" --> "Header Search Paths" and add the header search locations

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libxml2.2.dylib/**



Q4) Have you written nib file manually.

Ans) Yes. We can write code in ViewController, under "LoadView" method to programmatically add controls on the page.


[Note: This questions were asked by interview at Barnes & Nobles on 02/11/2010]