InterviewQuestionAndAnswer

Q1.What is Objective-C.? Ans:-

  • Objective-C is a general purpose high level Object Oriented programming language.
  • Objective-C programming language designed by using C and Smalltalk-80 programming language.
  • Objective-C programming language follows smalltalk message passing style(syntax) along with ‘C’ programming concept.
  • Objective-C is a main Programming language used by Apple for the OS-X & iOS operating System.
  • In 1970’s Dennis Ritchie sir was developed C Programming language but, this language is not popular until Unix-OS is not released.
  • In 1980’s Brad J.Cox designed Objective-C language based on Smalltalk 80 and C language.
  • In the year of 1988 objective c language developed its library & development environment called NEXTSTEP by NeXT software.
  • In 1992, objective c language became open source.
  • In 1994, Next Computer and Sun Microsystem released a standardized specification of the NextStep system called OPENSTEP.
  • Free software Foundation implementation of OPENSTEP is called GNUSTEP.

Q2.What is Delegate.? Ans:-

  • A delegate allows one object to send messages to another object when an event happens. For example, if you’re downloading data from a web site asynchronously using the NSURLConnection class. NSURLConnection has three common delegates:
  •  - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
     - (void)connectionDidFinishLoading:(NSURLConnection *)connection
     - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response

Q3.Why NSURLSession.? Ans:-

  • The NSURLSession Class and related classes provide an API (Application Interface Programming) for downloading content by way of HTTP(Hypertext Transfer Protocol).
  • This API provide rich set of delegate method for supporting authentication and gives ability to your app performing Background download when your app is not running.
  • If your app suspend then also NSURLSession rich delegate method ability to background run or download.
  • NSURLSession API,your app create a series of session,each of which coordinates a group of related task.
  • in Session there are three types of configuration object.
  • 1) default sessions 2) ephemeral sessions 3) download sessions
  • default session load the contents of a URL by providing a URL request object. You perform most of your configuration on the URL request object itself. default sessions that behave much like NSURLConnection.
  • ephemeral session that do not cache anything to disk.
  • download session that store the result in file and continue data even when your app is suspended,exits or crash.
  • within session,you can schedule three type of task.
  • 1) data tasks 2) download tasks 3) upload task
  • data tasks for retrieving data to memory, download tasks for downloading file to disk, upload task for uploading a file from disk and receiving the response as data in memory.

Q4.How are the NSURLSession class Hierarchy? Ans:-

  • NSURLSession – First we need to create object of NSURLSession class i.e A Session Object.
  • NSURLSessionConfiguration – A Configuration object used when initializing the object.
  • NSURLSessionTask – A base class for within a session. >>NSURLSessionDataTask – A Task for retrieving a contents of a URL as an NSData Object >NSURLSessionUploadTask – A Task for uploading a file, then retrieving the contents of a URL as an NSData Object >>NSURLSessionDownloadTask – A task for retrieving the content of a URL as a temporary file on disk.
  • NSURLSession API provide 4 protocol,that define delegate method for your app to more option to session task
  1. NSURLSessionDelegate – Define the delegate method to handle session-level events
  2. NSURLSessionTaskDelegate – Define the delegate method to handle task-level events common to all task type.
  3. NSURLSessionDataDelegate – Define delegate method to handle task-level events specific to data and upload task
  4. NSURLSessionDownloadDelegate – Define delegate method to handle task – level specific to download content
  • NSURLSession need this class also. (1) NSURL – Create object type of NSURL (2) NSURLRequest – Encapsulate metadata related to a URL request. including the URL, request method, and so on. (3) NSURLResponse – Encapsulate metadata related to a servers response’s to a request such as the content MIME (Multi-Purpose Internet Mail Extension) type and length . (*3) NSHTTPURLResponse – Add additional metadata specific to HTTP request. (4) NSCachedURLResponse – Encapsulate NSURLResponse object, along with the actual body data of the server’s response for caching purpose.

Q5. What is metadata? Ans:-

  • a set of data that describes and gives information about other data.

Q6. What is JSON? Ans:-

  • In iOS5 the foundation framework including the class name as NSJSONSerialization. that can easily transform NSData-JSON Object into an NSDictonary .
  • JSON stand for JavaScript Object Notation and it’s a lightweight data-interchange format. it is easy to human read and write.
  • JSON structure very simple and easy to understand.it’s a based on a subset of the JavaScript Programming language.
  • JSON file name extension is .json where as Uniform identifier is public.json.

*USE OF JSON

  • JSON Format is used for serialising and transmitting structure data over network connection.
  • this is primary use for transmit data between server and application

*JSON an ideal data interchange language. JSON build on two Structure

  • A Collection of Name/Value pairs.in a various language languages this is a realised as an object, record,struct,dictionary,hash table,keyed list,or associated array.
  • An ordered list of value.

Q6. How we know it’s dictionary or array.? Ans:-

  • { } is a identifier of a dictionary where as array represented in ( )
  • Dictionary want Object and its Key,(Key and value)

Q7. What is ARC? Ans:-

  • Automatic Reference Counting(ARC) is a compiler feature that provide automatic memory management of Objective-C Object.
  • ARC Support in XCode4.2 for OSX v10.6,OSX v10.7 and iOS4 and iOS5
  • ARC evaluate the lifetime requirements of your object and automatically insert appropriate memory management calls for you at compile time. and compiler also generate for you dealloc method.
  • ARC take care of memory management.
  • ARC provides @autoreleasepool.

Q8. What is strong and weak.? Ans:-

  • this is a two memory management attributes for properties introduced by in ARC.
  • weak
  • Weak reference are not support in OSX v.10.6 and iOS4>Weak reference does not extend the lifetime of object it points to, and automatically becomes nil when there are no strong reference to the object.
  • Weak reference most commonly used in the connection with thing such as a notification.you will keep weak reference to an object and keep it sending it messages as long as it is referenced elsewhere,then you can have cleaned up automatically later.
  • It says to the compiler keep this member as long as possible.
  • On weak members we can’t call retain or release methods
  • When the weak member is de-allocated then automatically pointer will set to nil.

Q9. What is copy? Ans:-

  • This attribute is required for mutable objects.
  • Copy attribute will specify that old value required to copy with new data.
  • use this copy attribute when if you need the value of the object as it is at this moment, and you don’t want that value to reflect any changes made by other owners of the object.
  • You will need to release the object when you are finished with it because you are retaining the copy.

Q10. What is MRR? Ans:-

  • Manual Retain Release.
  • If your project or if you doing practice in Manual Retain Release environment then your responsibility to claim and relinquish ownership of every object in your program.

Q.11 History of Mobile Operating System. Ans:-

  • From 1979-1999 all mobile working with the help of embeded system.
  • In the year of 1993, first smartphone os is released with the name called IBM siemen.
  • In the year of 1996, Microsoft released Windows CE OS for mobiles.
  • In the year of 1999, Nokia introduced S40 OS for their own products.
  • In the year of 2000, symbian OS is introduced in the market with 2G technology.
  • In the year of 2001, enhachment of palm OS is introduced.
  • In the year of 2002, BlackBerry introduced their own OS.
  • In the year of 2005, Nokia realesed “Maemo OS”.
  • In the year of 2007, Apple corporation release their own os called iOS with 3G features.
  • In the year of 2008, google introduced Android OS.
  • In the year of 2009, Samsung introduced BADA OS.
  • In the year of 2010, Microsoft Introduced windows OS for windows mobile.
  • In the year of 2012, Mozila corporation introduced firefox OS for Mobile.
  • In the year of 2013, BlackBerry released RIM(Research In Motion) OS.
  • Common Operating system for Mobile. 1)Android from google, It’s a free and open source. 2)BADA from samsung its a own OS for Samsung Mobile. It’s a close source. 2)Symbain from Nokia, it’s an open licensed source. 4)Windows phone from Microsoft, it’s a closed source. 5)BlackBerry from QNX software, it’s a closed source. 6)Brew from Qualcomm, it’s a closed source. 7)Windows 8 from Microsoft, closed Source.

Q.12 Can you explain about iOS and its History? Ans:-

  • It is a own Operating System of Apple Corporation, By using iOS only Apple device are work like, iPhone, iPad,iPod,Apple Tv.
  • The orignal name of ‘iOS’ is ‘OSX’ and it was renamed as iOS on 7th June 2010.
  • The first version of iOS is released on June 29th 2007.(Version 1.0).
  • On 1st July 2008 iOS, 2nd version is released i.e 2.0V.
  • On 17th June 2009 iOS, 3rd Version is released i.e 3.0V.
  • On 2nd Feb 2010 1st Generation iPad is released with 3.2version.
  • On 21st June 2010 iOS 4.0 is released with the multitask features.
  • The iPod 2nd generation and iPhone 3G implemented based on 4.0 only.
  • On june 6th 2011, iOS released 5.0 with Apple TV and many more features.(Click here to iPhone Features).
  • iOS 5.0 can support all iPad version, iPhone 3G,3GS,4,4S model also along with iPad 3rd and 4th generation.
  • On 19th Sep 2012, iOS6.0 introduced with Siri, Facebook Integration, Maps and lot of new features.(siri for blind people)
  • On 18 th sep 2013, iOS7.0 introduced in markets with enhancement features(Click here to Features).
  • To develope any kind of iOS Application we need MAC OS.
  • For iOS releated application, we require to use IDE i.e XCode.

Q.13 What is NSAutoreleasePool? Ans:-

  • It is a predifine interface or class which is avilable in foundation framework.
  • Pool is a object of type NSAutoreleasePool which holds reference of pool memory.
  • By using ‘alloc’ method we are creating pool of memory for current application.
  • By using ‘init’ method, dynamically created memory will initialize.
  • ‘drain’ is a predifined method by using this method we are deallocating dynamically created pool memory. Ex. #import<Foundation/Foundation.h> int main(int argc, const char *argv[]) { @autoreleasepool{ int a,b; NSLog(@”Enter 2 values”); scanf(“%d %d”,&a,&b); NSLog(@”Sum of %d + %d = %d”,a,b,a+b); } }

Q.14 What is NSLog? Ans:-

  • It is a predefined method which is avilable in foundation framework.
  • By using this predifined method we can print the data on console i.e debug window.
  • When we are working NSLog method, it can take any number of arguments but, first argument must NSString type that why we require to indicate ‘@’ symbol.

Q.15 Object Oriented Concept in Objective-C. Ans:-

  • Whenever programing language support OOP concept then it’s called Object Oriented Programming Language.
  • In any OOP language we having four OOP concept i.e AEIP
  • 1)Abstraction 2)Encapsulation 3)Inheritance 4)Polymorphism Abstraction – It is a concept of providing the information an entity without any implementation. Encapsulation – It is a concept of providing the security for the data with the help of private or protected variables. Polymorphism – It is a concept of implementation of method multiple time with same name. Inheritance – Deriving the properties of base class to derived class is called inheritance. In Objective C, we having two types of inheritance i.e 1)Single inheritance 2)Multilevel Inheritance Single inheritance – When we are deriving a class from single base class it is called single inheritance. Multilevel inheritance – Deriving a class from an exisiting derived class is called multilevel inheritance.

Q.16 What is assign.?Ans:-

  • his attribute will work like assigment operator.
  • Assign property having setter method only.
  • By using this attribute we can generate ‘C’ primitive type datatypes.

Q.17 What is use of copy attribute.?Ans:-

  • This attribute is required for mutable objects.
  • Copy attribute will specify that old value required to copy with new data.

Q.18 UIAlertView.?Ans:-

  • By Using this controller we can pass alertview in device.
  • When we are working with alertview, it can’t be customized i.e default view only visible.
  • If we required to handle UIAlertview button options then we required to implement UIAlertviewDelegate method.
  • Generally this all method are optional i.e if we required to perform the task then only recommended then go for delegate method.

Q.19 UISwitch.?Ans:-

  • By using this control we can place switch.
  • UISwitch having two options.i.e ON or OFF.
  • When we are working with UISwitch control then we need to handle UIControlEventChanged option.

Q.20 UIStepper.?Ans:-

  • By using this controller we can implement drop down list behavior in iOS.
  • Genarally this controller is recommonded to use when we required to place some quantity value.
  • UIStepper having three(3) major properties i.e minimum value, maximum value and step value.
  • Minimum value will provide minimum steper data.
  • Maximum value will provide maximum stepper data.
  • Step value provide differance between pervious value and new value.
  • When we are working with UIStepper if you required to access stepper current value then go for value property.
  • On UIStepper we required to handle UIControlEventValueChanged action.

Q.21 UISlider.?Ans:-

  • By using this controller we can make volume control view.
  • When we are working with UISlider, we required to handle UIControlEventValueChange action.

Q.22 What is use of UITextField and explain it’s properties.? Ans:-

  • By using this view we can place single line text content.
  • When we are working UITextfield we require to implement UITextfieldDelegate methods.
  • When we are editing UITextfield data then automatically keyboard will appear.
  • UITextField propertie’s are.
  • 1)borderStyle 2)autocorrectionType 3)keyboardType 4)keyboardAppearance 5)returnKeyType 6)delegate 7)enable 8)secure/securityTextEntry
  • textFieldShouldReturn method will call when we click on return button of keyboard.
  • textFieldShouldBegingEditing will call when editing is started.
  • textFieldShouldEndEditing is called when editing is finished.
  • To hide the keyboard on any textField then we need to call resignFirstResponder method.
  • When we require to focus on any one of the text field then recommended to go for becomeFirstResponder method.
  • when we require to create non editable textField we doesn’t having any properties so, we required to hide the keyboard when user touches the specific textField.(in this case we can disable userInteraction aslo).

Q.23 What is UITextView.? Ans:-

  • When we required to enter multiline(more than one line using enter key) content then recommend to use UITextZView.
  • UITextView does not having border style property. so we required to make customized border.
  • When we are working with UITextView then we require to handle UITextViewDelegate methods.
  • When we are working with UITextView then return button doesn’t having default action. so programatically we required to handle return button action.

Q.24 What is @class.? Ans:-

  • By using this preprocessor directive we can provide forword declaration of any other class without using inheritance.
  • In implementation when we required to create a object of a class in other class without using inheritance then recommended to go for ‘@class’.
  • UIResponder class will provide event handling process by using user action.
  • UIApplicationDelegate is a protocol which allows to implement app life cycle related method.
  • AppDelegate is a current application delegate class which is inherited from UIResponder and UIApplication.
  • A view is a visual object that creates user interface of an iOS Application.
  • Views are defines within a specific rectangle area of a screen.
  • All views are subclass of UIKit,UIView classes.
  • UIWindow class provides the surfaces on screen which allow to add view components to display.
  • In any kind of iOS application only one UIWindow object is avilable.
  • We can not place any kind of UIControllers directly on UIWindow.
  • UIWinodw must be fit entire screen of the device.
  • UIView class provide model UI for displaying the content view.
  • viewController class is a subclass of UIViewController which allows to add any type of UIControllers.
  • AppDelegate is a subclass of UIResponder which allows to handle surface and App Life Cycle event.

Q.25 Explain iOS App LifeCycle. Ans:-

  • App Lifecycle events are available in AppDelegate.m file.
  • When we launching the application first time, then control will goes “application:didFinishLaunchingWithOption” method.
  • This method will be called only once when we starts the application.
  • All application related initilization must be take place within this method only.
  • The next method is called during the application launch i.e “ApplicationDidBecameActive”(if URL(Uniform Resource Locator)is not present).
  • This method may be called multiple time.
  • If the URL is available then control will enter info OpenURL or handleOpenURL method,from here control will goes to “ApplicatonDidBecameActive” method.
  • After applicationDidBecameActive mode control will goes to applicationWillEnterForeground method for handling UI events.
  • When user hits Home button or any interruption occures using phone calls or message then controll will goes to applicationWillResignActive method.
  • In this method only we required to pause application related tasks if anything is in running status.
  • From resignActiveMethod controll will goes to applicationDidEnterBackground method. this method can hold only for 5seconds so if we required more than this time, then required to handle “beginBackGroundTaskWithExpirationHandler” method.
  • When the application enter into background if the memory is not available then application terminated by OS.
  • When we double tap the Home button then application will be relaunched, when we are relaunching the application the controll will enter into foreground method, from there openURL or applicationDidBecameActive method will call.
  • Whenever the application is terminating then, applicationWillTerminate method will call.
  • Whenever app having memory related problem then applicationDidReceiveMemoryWarning method will called.
  • In implementation when we are working with push notification services the we require to handle 1)application:didReceiveRemoteNotification 2)application:didReceiveLocalNotification.

Q.26 What is a UITabbarController.? Ans:-

  • It is a subclass of UIViewController.
  • By Using UITabbarController we can create Tab based application.
  • In UITabBarController all views are placed on UITabBar.
  • For every view UITabBar contains a button called TabBarItem.
  • When we click on any TabBarItem then corresponding view will appear on screen.
  • When we are working with UITabBarController then recommended to place 3 or 4 TabBarItemOnly.
  • When we are working with UITabBarItem then that item image size should be 30X30 pixcel only and for retina image we can place 60X60 pixels.

Q27. What is Navigation Controller.?Ans:-

  • Navigation related functionalities can be implemented by using UINavigationController.
  • Navigation it’s use for go next view to next and back.(just like linking).
  • UINavigationController take the navigation text as a back button title otherwise by default is Back as a text.
  • If u want first view to second view then recommended to use for PushViewController, it is always work on left to right and automatically back also.
  • popVIewController what he doing he romove/close current view and returns the parrent view means return the one that pushed the current view).
  • when we required to remove view then we need to go for popViewController option and it will handle automatically by the navigationController and it works towards right to left.
  • when we are working with navigation related application by default UINavigationController will handles pop operation(view going back).

Q.28 Creating iOS apps using under this categories.Ans:-

  1. Planing
  2. Prototype
  3. Design
  4. Implementing and Testing
  5. Delivering

Q.29 What is stand for .ipa and .dmg.?Ans:-

  • .iPA stand for iOS App Storage Package and .dmg stand for Disk Image.

Q.30 Why need of protocol.?Ans:-

  • Protocol is set of methods in Objective-C.
  • Ex.You have a car project, Ok then tell me every car are same thing i.e wheel,doors,main body,mirror,color its a right well,so lets this all things gather in one i.e protocol.

Q.31 Explain the iOS Layers. Ans:

  • iOS Devide in 4 layers. 1) Cocoa Touch 2) Media 3) Core Services 4) Core OS
  • in Core OS.
    > OSX Kernal
    > Power Managment
    > Mach 3.0
    > Keychain Access
    > BSD
    > Certificates
    > Sockets
    > File System
    > Security
    > Bonjourin Core Services.
    > Collections
    > Core Location
    > Address Book
    > Net Services
    > Networking
    > Threading
    > File access
    > Performance
    > SQLite
    > URL(Uniform Resource Locater)Utilities.in Media.
    > Core Audio
    > JPEG,PNG,TIFF
    > OpenAL
    > PDF
    > Audio Mixing
    > Quartz(2D)
    > File access
    > Core Animation
    > SQLite
    > OpenGL ESin Cocoa Touch.
    > Multi-Touch
    > Core Motion
    > Localization
    > View Herarchy
    > Controls
    > Alerts
    > Web View
    > MapKit
    > Image Picker
    > Camera

Q.32 What is Categories in Objective-C.? Ans:-

  • By using categories it is possible to add new method to existing class without using subclass.(Inheritance)
  • TO implement the categories we dosen’t require existing class related .h and .m file.
  • Categories can be refer like class extension also.
  • A category can be declare for any classes even if we dn’t having orignal implementation source code such as for standers Cocoa or Cocoa TOuch classes.
  • Objective-C Categories provide the ability to add functionality to an object without subclassing or changing the actual object.
  • Genarally categories required to use to add the methods to existing classes like, NSString or our custom object also.
  • Subclassing is one way to add the functionality to on object but avoiding unnecessary. subclassing by using a category will help to reduce the amount of code and keep your project more organized.
  • In following case always recommended to go for categories.
  1. Extending and existing cocoa class.
  2. Class Extension
  3. Private method on a class.
    Syntax to create categories.
  • @inteface Class_Name(Category)
    Data members;
    Member Functions;
    @end
  • Always category related interface section should be exist within the headers file only.
  • @implementaion Class_Name(Category)
    Method Code
    @end
  • Note*:
    When we are working with the categories it will allow to add the method to existing class only i.e it is not possible to add any instance variable to the categories.
  • In implementation if we required instance variable to any existing class then, it must be required to go for class extension.

Q.33 Explain any 15 methods of NSString.? Ans:-

  • NSString is a predefine class available in Foundation Framework.
  • 1)stringWithString – By using this we can create a string object with another string content.(class method).
  • 2)Length – By Using this method, we can find length of string.
  • 3)stringByAppendString – By using this method, we can append a string to another string String appending always takes place at the end of the current string only.
  • 4)stringWithFormat – It is class method which is used to create a string object in customized format.(user define format string data).
  • 5)isEqualToString – This method is used to compare both string are same or not.This method return boolean value i.e YES or NO. this method use to access another string there same string character avilable.Match the one string to another string then go for isEqualToString.
  • 6)stringByAppendingFormat – By using this method, we can append customized string format data to existing string.
  • 7)lowerCaseString. – This method will convert current string content in lower case format (chractrer’s).
  • 8)upperCaseString – This method will convert current string data into lower case.
  • 9)stringWithUTF8String – It is a class method which is used to create NSString object into ‘C’ type string.
  • 10)compare – By using this method, we can compare 2 string.Compare method returns NSComparisonResult value.NSComparisonResult value can be NSOrderedAscending or NSOrderedSame or NSOrderedDescending.
  • 11)subStringToIndex – By using this method we can extract the substring upto give location.
  • 12)subStringFromIndex – By using this method we can extract the substring from given location to end of the string.
  • 13)substringWithRange – By using this method we can extract the substring in specific range.When we are using this method we require to pass NSRange value. i.e location , length.
  • 14)rangeOfString – This method will return substring range in the form of NSRange data i.e location and length.
  • 15)UTF8String – This method is used to convert unicode string to C type string.(NSString to char*)

Q.34 Memory Management in Objective-C. Ans:

  • In Objective-C we having two type of memory management i.e Static Memory Management & Dynamic Memory Management
    1)Static Memory Management
  • When we are creating the memory of the time of compilation then it is called compile time memory management or static memory management.
    Generally in Objective-C, doesn’t require to go for Static Memory allocation.
    2)Dynamic Memory Allocation
  • When we are creating the memory at the time of execution then it’s called dynamic memory allocation.
    In Objective-C NSAutoReleasePool class is responsible for dynamic memory allocation.
    In Objective-C dynamic memory allocation will handle by reference counting mechanism.

Q.35 What is Reference Count in Objective-C’s Memory Management.?Ans:-

  • This is Objective-C Memory technique which holds number of counts which is handling by Object. i.e one object is holding how many reference are count value.
  • When we are allocating the memory for any object then automatically reference count is incremented by 1. Ex. NSString *stringObject=[NSString alloc]init]; means you allocating the memory for stringObject. when we are releasing the memory then autometically reference count decrese by one (1).
  • Whenever one object reference count values is Zero(0) then it’s called object is free.
  • When we are using the “release” method then it will deallocate memory for the object and reference count also decrese by one (1).
  • When we are calling “retain” method then memory will deallocated for the object but reference count will not decrease.
  • When we are working with autoreleasepool object then always recommended to use “drain” method only because,”drain” method will call garbage collection system.
  • Garbage Collection is a automated process which will destroyed the application related memory when the application will terminated.
  • In place of creating object of type NSAutoreleasePool then always recommended to go for “@autoreleasepool” block.
    @ autoreleasepool
    {
    //code beniffiting from a local autoreleasepool
    }
  • In place of holding the reference count manually and deallocating by using “release” or “retain” it is recommended to go for ARC(Auto Reference Counting).
  • According to autorelease method whenever reference count value is zero then automatically object will be destroyed.
  • If we require to make enable ARC, then go for select Project File->Choose build setting and go to “APPLE LLVM Compiler 4.2- language” and choose Objective-C Auto Reference Count(ARC) YES or NO.

Q.35 What is use of Segmented Control in iOS Ans:-

Q.36 What is SQLite.? Ans:-

  • SQLite is a public-domain software package that provides RDBMS(Relational Database Management System)
    Relational database systems are used to store user-defined records in large tables.
    Features of SQLite.
  • 1)Serverless.
    SQLite is a serverless does not require a separate server process or system to operate.The SQLite
    library accesses its storage files directly.
  • 2)Zero Configuration
    No server means no setup. Creating an SQLite database instance is as easy as opening a file.
  • 3)Cross-Platform
    The entire database instance resides in a single cross-platform file, requiring no administration.
  • 4)Self-Contained
    A single library contains the entire database system, which integrates directly into a host application.
  • 5)Small Runtime Footprint
    The default build is less than a megabyte of code and requires only a few megabytes of memory. With some adjustments, both the library size and memory use can be significantly reduced.
  • 6)Transactional
    SQLite transactions are fully ACID-compliant, allowing safe access from multiple processes or threads.
  • 7)Highly Reliable
    The SQLite development team takes code testing and verification very seriously.
    SQLite package the entire database into a single file.That single file contains the database layout as well as the actual data held in all the different tables and indexes and this file format is cross-platfrom and can be accessed on any machine, regardless of native order or word size.
  • All SQLite source written in C.
  • SQLite database files support the UTF-8, UTF-16LE and UTF16BE encoding.

Q.37 What are the default configuration of SQLite.?Ans:-

  • The compiled SQLite library is less than 700KB on most platfroms and requires less than 4 MB of memory to operate.
  • The library can often be trimmed to 300 KB or less. With minor configuration changes, the library can be made to function on less than 256 KB of memory, making its total footprint not much more than half a megabyte, plus data storage.

Q.38 What are the size of SQLite library. ? Ans:-

  • Compiled library file size is less than 700KB.

Q.39 How many memory reuire to operate SQLite database file.?Ans:-

  • Most platfroms and requires less than 4 MB of memory to operate.

Q.40 What are the SQLite features.? Ans:-

  • 1)Serverless
    2)Zero Configuration
    3)Cross-Platfrom
    4)Self-Contained
    5)Small Runtime Footprint
    6)Transactional
    7)Highly Reliable

Q.41 How to create SQLite3 database using mac Terminal.?Ans:-

  • 1. Using spolight(press the cmd+space) search the terminal, Terminal its a default editor avilable in mac. or in the Menu go on Application -> Terminal.
  • 2.First select the location where you want save your database file. i choose desktop. then type the command CD Desktop (semicoln ; not require).
  • 3. type the command “SQlite3 database_name.sqlite” and press enter. for your understanding purpose i create database name as MyCircle.
    ex – SQLite3 MyCircle.sql
    *note: you can give extension of your database file as .sql,.sqlite,.db
  • 4. after creating the database for using .databases command you can show the list of databases.
    ex – .databases;
  • 5. after if u create successful database then required to go for create the table for storing and manage the data.
    ex. create table Table_Name(field_name1, type, field_name2 type,fild_n type_n); (After writing query must and should semicolon ; required otherwise execution time you get output like…>)
    ex. create table Friends(ID integer primary key autoincrement, Name varchar(60), Age int);
    *note :- this Friends table belong to MyCircle database.
  • 6.After without any error creating table you need for feel the some data in that table then go for insert statement.
    ex. insert inot table_name values(value1,value2,value_n);
    *note :- fill the value as per datatype. if datatype is varchar then require data in single qoute ‘ ‘ where as integer type no required.
    ex. insert into Friends values(1,’Nitin’,21);
    explanation:- ID is 1, Name type as a varchar then require ‘Nitin’.

Q.42 Write the SQlite3 query for display all record.? Ans:-

  • select * from Table_Name;

Q.43 Write the SQlite query for display particular field record.?Ans:-

  • select Field_Name from Table_Name;

Q.44 Write the SQLite query for display more than one filed record.?Ans:-

  • select field_name1,field_name2,field_name3,field_name..n from Table_Name.

Q.45 What are the use of WHERE clause in SQLite.?Ans:-

  • By using WHERE clause in SQLite3 you can find particular name where its uniq identity or using WHERE clause you can get particular id information of object where the uniq name avilable.
  • Basically use of this query whenever you want information about particular one employee and they have itself diffierent uniq identity just like mobile number, componey id, roll number so by using where clause if u find the uniq id ex.123 then give me information about 123 number id emploee.
  • ex.
    select * from table_name where field_name=123;
    select filed_name from table_name where field_name=123;

Q.46 Write the SQlite query for find the age between 10 to 20 and show list of that name whose age between 10 to 20.? Ans:-

  • Database Name: MyCircle, Table Name: Friends
    |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |
    | 7 |Gopi | 08 |
    | 8 |Rushi | 04 |
    | 9 |Didi | 04 |
  • select * from Friends where Age between 10 and 20;
  • output
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |

Q.47 Execute the SQLite query where id is 5. Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |
    | 7 |Gopi | 08 |
    | 8 |Rushi | 04 |
    | 9 |Didi | 04 |
  • select * from Friends where ID=5;
  • output
    | 5 |Pavan | 16 |

Q.48 Execute the SQLite query where Nitin is avilable and display all inforamtion about Nitin. Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |
    | 7 |Gopi | 08 |
    | 8 |Rushi | 04 |
    | 9 |Didi | 04 |
  • select * from Friends where Name=’Nitin’;
  • output
    | 1 |Nitin | 21 |

Q.49 Write the SQLite query for display result in ascending order(Display the age coloum as a ascending order) Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |
    | 7 |Gopi | 08 |
    | 8 |Rushi | 04 |
    | 9 |Didi | 03 |
  • select * from Friends order by Age;
  • output
    | 9 |Didi | 03 |
    | 8 |Rushi | 04 |
    | 7 |Gopi | 08 |
    | 6 |Akash | 10 |
    | 5 |Pavan | 16 |
    | 4 |Sama | 18 |
    | 3 |Ganesh| 20 |
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |

Q.50 Write the SQLite query for display result in descending order(Display the age coloum as a ascending order) Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |
    | 7 |Gopi | 08 |
    | 8 |Rushi | 04 |
    | 9 |Didi | 03 |
  • select * from Friends order by Age desc;
  • output
    | 2 |Kaka | 22 |
    | 1 |Nitin | 21 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
    | 5 |Pavan | 16 |
    | 6 |Akash | 10 |
    | 7 |Gopi | 08 |
    | 8 |Rushi | 04 |
    | 9 |Didi | 03 |

Q.51 Execute the delete query in SQLite. Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
  • Synatx: delete from table_name [where expr..];
  • delete from Friends where id=1;
  • output:
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |

Q.52 Execute the insert query in SQLite.Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
  • Syntax: insert into table_name [(column-list)] values (value-list);
  • Query: insert into Friends(ID,Name,Age) values (1001,’swamiOS’21);
  • Output:
    | 1001 |swamiOS | 21 |

Q.53 Execute the Update query in SQLite and chane the Nitin name as a Amol. Ans:-

  • Database Name: MyCircle, Table Name: Friends
  • |ID|Name |Age|
    | 1 |Nitin | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |
  • syntax: update tableName set FiledName=? where FieldName=?
    or
  • syntax: update tableName set assignment [, assignment]”[where expressionn];
  • Query: update Friends set Name=’Amol’ where ID=1;
  • Output:
    |ID|Name |Age|
    | 1 |Amol | 21 |
    | 2 |Kaka | 22 |
    | 3 |Ganesh| 20 |
    | 4 |Sama | 18 |

Q.54 How to create table in SQLite3.? Ans:-

  • Syntax: create table if not exixts table_name (column-def [, column-def]*[,constraint]* note: constraint means give primary key autoinc etc…
    OR
  • Syntax: create table table_name(columnField, columnDataType)
  • Query: create table if not exists dummyData(dummyId integer, dummyName text);

Q.55 Can SQLite able to access read-only database file.?Ans:-

  • Yes.

Q.56 SQLite Access Control.? Ans:-

  • SQLite database has no authentication data.
  • SQLite dependes on filesystem permission to control access to the raw database file.
  • There are three type/limit of access
    1)read/write access.
    2)read-only access.
    3)write access

Q.57 You know SQLite download link.? Ans:-

Q.58 What is Amalgamation.? Ans:-

  • The official code distribution is known as the amalgamation. The amalgamation is a single C source file that contains the entire SQLite core. It is created by assembling the individual development files into a single C source file that is almost 4 megabytes in size and over 100,000 lines long.
  • The amalgamation has two main advantages. First, with everything in one file, it is extremely easy to integrate SQLite into a host application. Many projects simply copy the amalgamation files into their own source directories. It is also possible to compile the SQLite core into a library and simply link the library into your application.Second, the amalgamation also helps improve performance. Many compiler optimizations are limited to a single translation unit. In C, that’s a single source file. By putting the whole library into a single file, a good optimizer can process the whole package at once.
  • When working with the amalgamation, there are four important source files:
    1)sqlite3.c
    2)sqlite3.h
    3)sqlite3ext.h
    4)shell.c
  • sqlite3.c and sqlite3.h, are all that is needed to integrate SQLite into most applications.
  • The shell.c file contains the source code for the sqlite3 command-line shell. All of these files can be built on Linux, Mac OS X, or Windows, without any additional configuration files.

Q.59 Why SQLite SQL statement terminated with a “;”(semicolon).?Ans:-

  • If you’re using an interactive application, such as the sqlite3 command-line tool, then you’ll need to use a semicolon to indicate the end of a statement.

Q.60 How to pass single-line-commnet and double-line-comment in SQLite.?Ans:-

  • Single-line comments start with double dash(–).
  • Multi-line comments start /* and end */.(/*-_-_ _-*/)

Q.61 SQLite Operators.Ans:-

  • SQLite support unary prefix operators.
    1) – +
    2) ~
    3) NOT (for boolean expr..)
    4) || (for string concatenation)
    5) + – * / % (standerd arithmetic operators)
    6) | & << >> (bitwise operator or, and, shift-high,shift-low)
    7) < <= => > (Comparison test operator less-than, less-than or equal, greater-than or equal, greater-than)
    8) = == != <> (Equality test operator. = and == will test for equality while != and <> test for inequality.
    9) IN LIKE GLOB MATCH REGEXP(these are five keywords)
    10) AND OR (Logical operators)

Q.62 Explain DDL.?Ans:-

  • DDL stand for Data Defination Language.
  • By using DDL refers to command that define the structure of table, views, indexes and other data containers and objects within the database.
  • ex of DDL commands.
    CREATE TABLE – used to create new tbl.
    DROP VIEW – used to delete a view.

Q.63 Explain DML.Ans:-

  • DML stand for Data Manuplation Language.
  • DML command are insert, update, delete,
  • ex of DML commands.
    insert – used to insert new values into a table.
    select – look up data from tables.

Q.64 Explain TCL. Ans:-

  • TCL stand for Transaction Control Language.
  • DML and DDL is the TCL.
  • TCL commands can be used to control transaction of DML amd DDL commands.
  • ex of TCL commands.
    BEGIN – used to begin a multistatement transaction.
    COMMIT – used to end and accept a transaction.

Q.65 Explain DCL.Ans:-

  • DCL stand for Data Control Language.
  • By usign DCL you can give file permission using its grant or revoke access control.
  • DCL commands used to allow or deny specific data user permision to utilize or access specific resource within a database.
  • DCL commands used to allow or deny group of users permision to utilize or access specific resource within a database.
  • ex of DCL commands.
  • GRANT – used to assign a permission.
  • REVOKE – used to delete and existing permission

Q.66 How many datatypes support in SQLite or SQLite Datatypes are.? Ans:-

  • SQLite support only five concrete datatypes.i.e NULL,Integer,Float,Text,BLOB.
  • 1) NULL – A NULL is considered its own distinct type. A NULL type does not hold a value. Literal NULLs are represented by the keyword NULL.
  • 2)Integer – size is 8 bytes. range -9,223,372,036,854,775,808 to +9,223,372, 036,854,775,807,(19 digits)
  • 3)Float – A floating-point number, stored as an 8-byte value in the processor’s native format. For nearly all modern processors, this is an IEEE 754 double-precision number. Literal floating-point numbers are represented by any bare series of numeric digits that include a decimal point or exponent.
  • 4)Text -A variable-length string, stored using the database encoding (UTF-8, UTF-16BE, or UTF-16LE). Literal text values are represented using character strings in single quotes.
  • 5)BLOB – A length of raw bytes, copied exactly as provided. Literal BLOBs are represented as hexadecimal text strings preceded by an x. For example, the notation x’1234ABCD’ represents a 4-byte BLOB. BLOB stands for Binary Large OBject.

Q.67 How to delete SQLite table.?Ans:-

  • Using DROP TABLE commands.
  • Drop Table commnads deletes a table and all of the data it contains.
  • synatax : drop table table_name

Q.68 What is Virtual tables in SQLite.?Ans:-

  • Virtual tables can be used to connect any data source to SQLite, including other databases.
  • A virtual table is created with the CREATE VIRTUAL TABLE command.
  • Virtual tables cannot be made temporary, nor do they allow for an IF NOT EXISTS clause. To drop a virtual table, you use the normal DROP TABLE command.

Q.69 ACID stand for.? Ans:-

  • ACID stand for Atomic,Consistent,Isolated,Durable.

Q.70 Whait is Save-Points in SQLite.? Ans:-

  • SQLite also support save-point.
  • Savepoints allow you to mark specific points in the transaction. You can then accept or rollback to individual save-points without having to commit or rollback an entire transaction. Unlike transactions, you can have more than one save-point active at the same time.
  • Save-points are sometime called nested transaction.
  • You can create a save-point with the SAVEPOINT command.
  • Command : SAVEPOINT savepoint_name
  • Save-points act as a stack. Whenever you create a new one, it is put at the top of the stack. Save-point identifiers do not need to be unique. If the same save-point identifier is used more than once, the one nearest to the top of the stack is used.
  • To release a save-point and accept all of the proposed changes made since the savepoint was set, use the
  • RELEASE command:
  • RELEASE [SAVEPOINT] savepoint_name
  • To cancel a set of commands and undo everything back to where a save-point was set, use the ROLLBACK TO command:
    ROLLBACK [TRANSACTION] TO [SAVEPOINT] savepoint_name

Q.71 Explain FROM Clause in SQLite.?Ans:-

  • The FROM clause takes one or more source tables from the database and combines them into one large table.
  • Tables are combined using the JOIN operator.
  • Three or more tables can be joined together by stringing a series of JOIN operator togrther.
  • Joins are the most important and most powerful database operator. Joins are the only way to bring together information stored in different tables.

Q.72 How many types in SQLite to join the table.?Ans:-

  • SQLite defines three major types of joins.
    1)CROSS JOIN
    2)INNER JOIN
    3)OUTER JOIN

Q.73 Select Example using JOIN,AS,CROSS JOIN,JOIN ON,OUTER JOIN, Compound JOIN,Self JOIN. Ans:-

  • First create table.
  • CREATE TABLE x ( a, b );
    INSERT INTO x VALUES ( 1, ‘Alice’ );
    INSERT INTO x VALUES ( 2, ‘Bob’ );
    INSERT INTO x VALUES ( 3, ‘Charlie’ );
  • CREATE TABLE y ( c, d );
    INSERT INTO y VALUES ( 1, 3.14159 );
    INSERT INTO y VALUES ( 1, 2.71828 );
    INSERT INTO y VALUES ( 2, 1.61803 );
  • CREATE TABLE z ( a, e );
    INSERT INTO z VALUES ( 1, 100 );
    INSERT INTO z VALUES ( 1, 150 );
    INSERT INTO z VALUES ( 3, 300 );
    INSERT INTO z VALUES ( 9, 900 );
  • select * from x;
  • | a | b |
    | 1 | Alice |
    | 2 | Bob |
    | 3 | Charlie|
  • select d, d*d AS dSquared FROM y;AS|d |dSquared
    |3.14159 |9.8695877281
    |2.71828 |7.3890461584
    |1.61803 |2.6180210809here y table create time column name is c and d. after using select command using AS change the name.JOIN,CROSS JOIN
  • select * from x join y;
    select * from x cross join y;
    select * from x,y;
  • |a |b |c |d
    |1 |Alice |1 |3.14159
    |1 |Alice |1 |2.71828
    |1 |Alice |2 |1.61803
    |2 |Bob |1 |3.14159
    |2 |Bob |1 |2.71828
    |2 |Bob |2 |1.61803
    |3 |Charlie |1 |3.14159
    |3 |Charlie |1 |2.71828
    |3 |Charlie |2 |1.61803JOIN…ON
  • select * from x join y on a=c;
    |a| b |c| d
    |1| Alice |1| 3.14159
    |1| Alice |1| 2.71828
    |2| Bob |2| 1.61803
  • select * from x join z on x.a =z.a;
    |a| b |a| e
    |1| Alice |1| 100
    |1| Alice |1| 150
    |3| Charlie |3| 300OUTER JOIN
  • select * from x left outer join z using (a);
    |a| b |e
    |1| Alice |100
    |1| Alice |150
    |2| Bob |[NULL]
    |3| Charlie |300Compound JOIN
  • select * from x join y on x.a = y.c left outer join z on y.c = z.a;|a| b |c| d | a| e
    |1| Alice |1| 3.14159| 1| 100
    |1| Alice |1| 3.14159| 1| 150
    |1| Alice |1| 2.71828| 1| 100
    |1| Alice |1| 2.71828| 1| 150
    |2| Bob |2| 1.61803| [NULL]| [NULL]Self JOIN
  • select * from x as x1 join x as x2 on x1.a+1=x2.a;
    |a| b |a| b
    |1| Alice |2| Bob
    |2| Bob |3| Charlie

Q.74 WHERE Example in SQLite using BETWEEN Ans:-

  • First create table.
  • CREATE TABLE x ( a, b );
    INSERT INTO x VALUES ( 1, ‘Alice’ );
    INSERT INTO x VALUES ( 2, ‘Bob’ );
    INSERT INTO x VALUES ( 3, ‘Charlie’ );
  • CREATE TABLE y ( c, d );
    INSERT INTO y VALUES ( 1, 3.14159 );
    INSERT INTO y VALUES ( 1, 2.71828 );
    INSERT INTO y VALUES ( 2, 1.61803 );
  • CREATE TABLE z ( a, e );
    INSERT INTO z VALUES ( 1, 100 );
    INSERT INTO z VALUES ( 1, 150 );
    INSERT INTO z VALUES ( 3, 300 );
    INSERT INTO z VALUES ( 9, 900 );
  • select * from x where b= ‘Alice’;
    |a|b
    |1|Alicerange of values.
  • select * from y where d between 1.0 and 3.0
    |c|d
    |1|2.71828
    |2|1.61803sum of c and d
  • select c,d c+d as sum from y where sum<4.0;
    |c| d | sum
    |1| 2.71828| 3.71828
    |2| 1.61803| 3.61803

Q.75 GROUP BY Example in SQLite using count,sum,average,HAVING .Ans:-

  • First create table.
  • CREATE TABLE x ( a, b );
    INSERT INTO x VALUES ( 1, ‘Alice’ );
    INSERT INTO x VALUES ( 2, ‘Bob’ );
    INSERT INTO x VALUES ( 3, ‘Charlie’ );
  • CREATE TABLE y ( c, d );
    INSERT INTO y VALUES ( 1, 3.14159 );
    INSERT INTO y VALUES ( 1, 2.71828 );
    INSERT INTO y VALUES ( 2, 1.61803 );
  • CREATE TABLE z ( a, e );
    INSERT INTO z VALUES ( 1, 100 );
    INSERT INTO z VALUES ( 1, 150 );
    INSERT INTO z VALUES ( 3, 300 );
    INSERT INTO z VALUES ( 9, 900 );
  • select a, count(a) as count from z group by a;
    |a|count
    |1|2
    |3|1
    |9|1
  • select a, sum(e) AS total from z group by a;
    |a|total
    |1|250
    |3|300
    |9|900
  • sqlite> select a, sum(e), count(e),
    …> sum(e)/count(e) as expr, avg(e) as agg
    …> from z group by a;
    |a| sum(e) |count(e) |expr| agg
    |1| 250 |2 |125| 125.0
    |3| 300 |1 |300| 300.0
    |9| 900 |1 |900| 900.0HAVING
  • select a, sum(e) as

Q.76 How to post on facebook in iOS.?Ans:-

  • step 1- Select the singleView Application and give the name as ViewController& subClassOf UIViewController
  • step 2- Add framework. select project >> build phases >> Link Binary With Libraries and search the “Social.framework” and click on add button agan one more time search and add “Accounts.framework”
  • step 3- in your viewController.h neccesary to import the framework.
  • in viewController.h#import <UIKit/UIKit.h>
    #import “Social/Social.h”
    #import “Accounts/Accounts.h”@interface ViewController : UIViewController
    {
    SLComposeViewController *mySLComoserSheet;
    }-(IBAction)PostToFacebook:(id)sender;@end
  • After that go on viewController.m#import “viewController.h”
    @interface viewController()
    @end@implementation viewController
    -(void)viewDidLoad
    {
    [super viewDidLoad];
    }
    -(IBAction)PostToFacebook:(id)sender
    {mySLComoserSheet = [[SLComposeViewController alloc]init];
    mySLComoserSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    [mySLComoserSheet setInitialText:@”Hellow Steve post on Facebook”];
    [self presentViewController:mySLComposerSheet animated:YES completion:NULL];}
  • step 4- this is a imporatant step. Select storybord > select viewController and add one Button in the view with the POST ON FB name.
  • after that don’t forgot the connection PostToFacebook action method to Button. select touchUpInside.
  • step 5 – using command+B build your project and command+R run ur project in simulator. run and test.

Q.77 SQLite3 database connection functions and commands.Ans:-

  • 1)sqlite3_open() – will result in a database with the default UTF-8 encoding.
    2)sqlite3_open_v2() – will result in a database with the default UTF-8 encoding.
    3)sqlite3_open_16() – is used to create a database, the default string encoding will be UTF-16 in the native byte order of the machine.
    4)sqlite3_close() – To close and release a database connection.
    5)sqlite3_errmsg() – This allows the caller to retrive an error message.
    6)sqlite3_stmt – Once a database connection is established, we can start to execute SQL commands. This is normally done by preparing and stepping through statements.
    7)sqlite3_prepare_v2() – The prepare process converts an SQL command string into a prepared statement.
  • *note : Preparing an SQL statement causes the command string to be parsed and converted into a set of byte-code commands. This byte-code is fed into SQLite’s Virtual Database Engine (VDBE) for execution.
    8)sqlite3_step() – To execute the VDBE code.
    9)sqlite3_column_count() – Returns the number of columns in the statement result.
    10)sqlite3_column_name()/sqlite3_column_name16() – returns the name of the specified column as a UTF8 or UTF16 encoded string.
    11)sqlite3_finalize()
    12)sqlite3_reset()
    13)sqlite3_free()
    14)sqlite3_column_type() – return the native type (strong class) of the value found in the specified column.
    15)sqlite3_column_blob() – returns a pointer to the BLOB value from the given column.
    16)sqlite3_column_double() – returns a 64-bit floating-point value from the given column.
    17)sqlite3_column_int() – returns a 32-bit signed integer from the given column.
    18)sqlite3_column_int64() – return a 64-bit signed integer from the given column.
    19)sqlite3_column_text()/sqlite3_column_text16() – returns a pointer to a UTF-8 or UTF-16 encoded string from the given column.
    20)sqlite3_column_value() – returns a pointer to an unprotected sqlite3_value.
    21)sqlite3_column_type – to return undefined results.
    22)sqlite3_column_bytes() – returns the number of byte in a BLOB or in a UTF-8 text value.
    23)sqlite3_column_bytes16() – returns the number of bytes in UTF-16 encoded text value,including the terminator.
    24)sqlite3_reset() – reset a prepared statements so that it is ready for another execution.

Q.78 What are the SQLite standerd return codes.?Ans:-

  • SQLITE_OK Operation successful
    SQLITE_ERROR Generic error
    SQLITE_INTERNAL Internal SQLite library error
    SQLITE_PERM Access permission denied
    SQLITE_ABORT User code or SQL requested an abort
    SQLITE_BUSY A database file is locked (usually recoverable)
    SQLITE_LOCKED A table is locked
    SQLITE_NOMEM Memory allocation failed
    SQLITE_READONLY Attempted to write to a read-only database
    SQLITE_INTERRUPT sqlite3_interrupt() was called
    SQLITE_IOERR Some type of I/O error
    SQLITE_CORRUPT Database file is malformed
    SQLITE_FULL Database is full
    SQLITE_CANTOPEN Unable to open requested database file
    SQLITE_EMPTY Database file is empty
    SQLITE_SCHEMA Database schema has changed
    SQLITE_TOOBIG TEXT or BLOB exceeds limit
    SQLITE_CONSTRAINT Abort due to constraint violation
    SQLITE_MISMATCH Datatype mismatch
    SQLITE_MISUSE API used incorrectly
    SQLITE_NOLFS Host OS cannot provide required functionality
    SQLITE_AUTH Authorization denied
    SQLITE_FORMAT Auxiliary database format error
    SQLITE_RANGE Bad bind parameter index
    SQLITE_NOTADB File is not a database

Q.79 What is VFS.?Ans:-

  • VFS stand for Virtual File System.
  • VFS module use to use with database connection.
  • The VFS system acts as an abstraction layer between the SQLite library and any underlying storage system (such as a filesystem).
  • In nearly all cases, you will want to use the default VFS module and can simply pass in a NULL pointer.

Q.80 Memory Managment in SQLite3. Ans:-

  • When SQLite needs to dynamically allocate memory, it normally calls the default memory handler of the underlying operating system. This causes SQLite to allocate its memory from the application heap.
  • SQLite memory management functions:
  • sqlite3_malloc()
  • sqlite3_realloc()
  • sqlite3_free()
  • void* sqlite3_malloc( int numBytes ) Allocates and returns a buffer of the size specified. If the memory cannot be allocated, a NULL pointer is returned. Memory will always be 8-byte (64-bit) aligned.
  • void* sqlite3_realloc( void *buffer, int numBytes ) Used to resize a memory allocation. Buffers can be made larger or smaller. Given a buffer previously returned by sqlite3_malloc() and a byte count, *_realloc() will alloc new buffer of the specified size and copy as much of the old buffer as will fit into the new buffer. It will then free the old buffer and return the new buffer. If the new buffer cannot be allocated, a NULL is returned and the original buffer is not freed.
  • void sqlite3_free( void *buffer )
  • Releases a memory buffer previously allocated by sqlite3_malloc() or sqlite3_realloc().

Q.81 Explain touchesMoved:withEvent method.Ans:-

  • Gets continuously called while the user is dragging a finger on the screen.

Q.82 Explain touchesEnded:withEvent method.Ans:-

  • Gets called when the user lifts that finger off of the screen. Just like in the touchesMoved:withEvent: method, all we do is store off the final location in the lastTouch variable and indicate that the view needs to be redrawn.

Q.83 What is Quartz 2D and OpenGL ES.?Ans:-

  • Quartz 2D is a part of the Core Graphics framework and OpenGL ES is a cross-platfrom graphics library called OpenGL.
  • OpenGL ES is a slimmed down version of another cross-platform graphic library called OpenGL.
  • OpenGL ES is a subset of OpenGL designed specifically for embedded systems such as the iPhone.
  • Quartz is a set of functions, datatypes, and objects.

Q.84 What are the required method in UIPickerViewDataSource method.?Ans:-

  • There are two required method.
    -(NSInteger)pickerView:(UIPickerView *)pickerView;
    -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;

Q.85 UIPickerViewDelegate methods.Ans:-

  • All are the @optional method.
  • Following method are some selected important method for more read on Apple offical document.
  • 1) -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger *)component;
  • 2) -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
  • 3) -(CGFloat)pickerView : (UIPickerView *)pickerView widthForComponent:(NSInteger)component;
    4) -(CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent(NSInteger)component;

Q.86 How to set custom font on table text lables.?Ans:-

  • Cellobj.textLabel.font=[UIFont fontWithName=@”tahoma” size=18.0];

Q.87 What are the model transition style.?Ans:-

  • There are four transition style.
    1) UIModelTransitionStyleFilpHorizontal
    2) UIModelPresentationPageSheet
    3) UIModelTransitionStyleCoverVertical
    4) UIModelTransitionStyleCrossDissolve

Q.88 How to rename table in SQLite3.?Ans

  • ALTER TABLE old-table-name RENAME TO new-table-name;

Q.89 How to add column in already created table.?Ans:-

  • ALTER TABLE table-name ADD COLUMN column-name column-type;
    ex :
  • ALTER TABLE Student ADD COLUMN StudentID Integer;

Q.90 Which framework need for Email Application in iOS.?Ans:-

  • MessageUI.framework

Q.91. Gesture Recognizing in iOS.? Ans:-

1)Tapping (UITapGestureRecognizer): Tapping one or more fingers on the screen.

2)Long Pressing (UILongPressGestureRecognizer): Pressing one or more fingers to the screen for a specific period of time.

3)Pinching (UIPinchGestureRecognizer): Pinching to close or expand something.

4)Rotating (UIRotationGestureRecognizer): Sliding two fingers in a circular moton.

5)Swiping (UISwipGestureRecognizer): Swiping with one ormore fingers in a specific direction.

6)Panning (UIPanGestureRecognizer): Touching and dragging.

7) Shaking : Physically shaking the iOS device.


swamios.com ® swamios media ♫
Home-icon Home

iphone-black-ios-icon iOS Interview Question

letter-c-black-icon.png Objective-C

Icon_apple_16x16 Swift Programming

16x16-black-white-metro-download-icon Download

contact-new About-Us

swamios-media-png

 

Kalavati Technologies Pvt Ltd