UrbanPro
true

Learn iOS Developer from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

iOS Interview Questions

Naga Kranthi
23/05/2017 0 0

Q1.What is property?

Ans:Properties are used to access the instance variables from outside of class.

Q2. What is synthesized?

Ans:After you declare the property in objective­c . we have to tell the compiler instantly by using synthesize directive. Actually this tells to compiler to generate a getter&setter message.

Q4. What is retaining?

Ans:It is reference count of the object

Q5. What is webservice?

Ans:Main purpose is to expose the data in form of xml format ,by using this we can getting the data from server.

Q6. What is parsing?

Ans:To access the data in the xml element is called parsing.

Q7.Which class we can use for passing of xml in iphone?

Ans:By “NSXML” Parser.

Q8.Which type of parse we have use in iphone?

Ans:”SAX” parser.

Q9.Which class are used to establish connection b/w application to webserver?

Ans:(a)NSURL

(b)NSURL REQUEST

(c)NSURL CONNECTION.

Q10.What is difference between DOM&SAX?

Ans:(a)Dom is a documents based parser.

When we will work with these parser all the data of xml is stored in RAM. In this parser “memory consumption” is more.

(b)SAX is a event driven parser.When we will work with these parser,take only reference from xml file and generate the oneevent for every element.

Q11.After parsing if you want to get your data in view which delegation methods are did you use?

Ans:(a)did start element (b)did end elemen (c)found character.

Q12.How many methods are used in NSURLConnection?

Ans:I have 4 types methods

(a)Connection did receive Response

(b)Connection did recevice Datat

(c)Connection fail with error

(d)Connection did finish loading.

Q13.Tell me about json­parser?

Ans:”JSON” Means “Java script object notation”. It is a one type of parser (or)test­based and hightweight parser.

Q14.By default application which things contain?

Ans:In ipone applications by default having 3 things

1.main→It is entry point of application.

2.Appdelegate→It is perform the basic application & functionality.

3.Window→It is provide uiinterface.

Q15.What is uiviewcontroller?

Ans: uiview controller is base class for all the controller.

Q16. What is the navigation controller?

Ans: Navigation controller contains the stack of controllers every navigation controller must be having root view controller by default these controllers contain 2 method

(a) push view (b) pop view     By default navigation controller contain “table view”.

Q17. What is tab bar controller?

Ans: Tab bar is used to common way to display the data on iphone.

Q18. What is the table view controller?

Ans: Table view controller contains the number of rows and columns visible in the application and makes a cell editable or not as a response to key press

Q19. Which protocols are did used in table view?

Ans: Table view contain 2 delegate protocols

(a). Ui table view data source

In ui view table view data source contain these methods

In ui table view delegate contain these methods

(b). Ui table view delegate.

(a). No of sections.

(b). No of rows in sections.

(c). Cell for row index path row.

(a). Did select row at index path row

Q20. By default table view which controller contain?

Ans: Detail view controller that is present is ui table view delegate

Q21. What is the split view controller?

Ans: This control is used for ipad application and it contain proper controllers by default split view controller contain root view controller and detail view controller.

Q22. What are data base are used in iphone?

Ans: (a). Sql lite (b). Plist c). Xml (d). core data

Q23. Tell me about the MVC architecture?

Ans: M­model, V­view, C­controller   Main advantage of MVC architecture is to provide “reusability and security” by separating the layer by using MVC architecture.

Model: it is a class model is interact with database.

Controller: controller is used for by getting the data from model and controls the

views:  Viewdisplay the information in views.

Q24. What are frame works are used in iphone?

Ans: (a). Ui kit framework

(b). Map kit framework

(c). ADI kit framework

(d). Core data framework

(e).core foundation framework

Q25. What is the instance methods?

Ans: Instance methods are essentially code routines that perform tasks so instances    of clases we create methods to get and set the instance variables and to display   the current values of these variables.  Declaration of instance method :

(void)click me: (id)sender;  Void is return type which does not giving any thing here.  Click me is method name.  Id is data type which returns any type of object.

Q26. What is the class method?

Ans: Class methods work at the class level and are common to all instance of a  class these methods are specific to the class overall as opposed to working on different instance data encapsulated in each class instance.

@interface class name :ns object{

}

+(class name *)new alloc:

(int)total open

Q27. What is data encapsulation?

Ans: Data is contained with in objects and is not accessible by any other than  via methods defined on the class is called data encapsulation.

Q28. What are accessor methods?

Ans: Accessor methods are methods belonging to a class that allow to get and set  the values of instance valuables contained with in the class.

Q29. What is synthesized accessor methods?

Ans: Objective­c provides a mechanism that automates the creation of accessor  methods that are called synthesized accessor methods that are  implemented through use of the @property and @synthesized.

Q30. How to access the encapsulated data in objective­c?

Ans:(a)Data encapsulation encourages the use of methods to +get and set the values

(b)But the developer to want to directly access an instance variable with out having to

go through an accessor method. (c) In objective­c syntax for an instance variable is as  follow [class instance variable name]  of instance variables in a class.

Q31. What is dot notation?

Ans: Dot notation features introduced into version 2.0 of objective­c  Dot notation involves accessing an instance variable by specifying a class “instance” followed by a “dot” followed in turn by the name of instance variable or property to be accessed.

Q32. What is single inheritance in objective­c?

Ans: Objective­c subclass can only be derived from a single direct parent class this s concept is called as “single inheritance”.

Q33. Ns object is parent class or derived class?

Ans: Ns object is parent class and contains a number of instance variables and instance methods.

Q34. How to call function in objective­c

Ans: [account display account info]  Account­> object name

Display account info­> method name

35. What is advantage of categories? What is difference between implementing a category and inheritance?

Ans: You can add method to existing class even to that class whose source is not available to you. You can extend functionality of a class without subclassing. You can split implementation in multiple classes. While in Inheritance you subclass from parent class and extend its functionality.

36. Difference between categories and extensions?

Ans:Class extensions are similar to categories. The main difference is that with an extension, the compiler will expect you to implement the methods within your main @implementation, whereas with a category you have a separate @implementation block. So you should pretty much only use an extension at the top of your main .m file (the only place you should care about ivars, incidentally) — it’s meant to be just that, an extension.

37. Difference between protocol in objective c and interfaces in java?

Ans:Protocol is also way to relate classes that are not related in inheritance hierarchy. Protocols and interfaces both are used to achieve multiple inheritance. There is minor difference between these two. In Objective­C, protocols also implement NSObject protocol to access all the mehthods in NSObject

@protocol WebProtocol <NSObject>

@end

If I don’t implement NSObject explicitly, I will not be able to access NSObject methods like retain, release etc. when I access through WebProtocol instance. While in Java you don’t need to implement Object interface explicitly. It is implicitly implemented.

38. Can we use two tableview controllers on one view controller?

Ans: Yes, we can use two tableviews on the same view controllers and you can differentiate between two by assigning them tags…or you can also check them by comparing their memory addresses.

39. What is keyword atomic in Objective C?

Ans: When you place keyword atomic with a property, it means at one time only one thread can access it.

40. What are mutable and immutable types in Objective C?

Ans: Mutable means you can change its contents later but when you mark any object immutable, it means once they are initialized, their values cannot be changed. For example, NSArray, NSString values cannot be changed after initialized.

41. When we call objective c is runtime language what does it mean?

Ans: Objective­C runtime is runtime library that is open source that you can download and  understand how it works. This library is written in C and adds object­oriented capabilities to C and makes it objective­c. It is only because of objective c runtime that it is legal to send messages to objects to which they don’t know how to respond to. Methods are not bound to implementation until runtime. Objective­C defers its decisions from compile time to run time as much as it can. For example, at runtime, it can decide to which object it will send message or function.

42. What is difference between NSNotification and delegate?

Ans:Delegate is passing message from one object to other object. It is like one to one communication while nsnotification is like passing message to multiple objects at the same time. All other objects that have subscribed to that notification or acting observers to that notification can or can’t respond to that event. Notifications are easier but you can get into trouble by using those like bad architecture. Delegates are more frequently used and are used with help of protocols.

43. Swap the two variable values without taking third variable?

Ans:­ int x=10; int y=5;

x=x+y;

NSLog(@”x==> %d”,x);

y=x­y;

NSLog(@”Y Value==> %d”,y);

x=x­y;

NSLog(@”x Value==> %d”,x);

 

44. What is push notification?

Imagine, you are looking for a job. You go to software company daily and ask sir “is there any job for me” and they keep on saying no. Your time and money is wasted on each trip.

(Pull Request mechanism) So, one day owner says, if there is any suitable job for you, I will let you know. In this mechanism, your time and money is not wasted. (Push Mechanis)

How it works?

This service is provided by Apple in which rather than pinging server after specific interval for data which is also called pull mechanism, server will send notification to your device that there is new piece of information for you. Request is initiated by server not the device or client.

Flow of push notification

Your web server sends message (device token + payload) to Apple push notification service

(APNS) , then APNS routes this message to device whose device token specified in

notification.

What is polymorphism?

This is very famous question and every interviewer asks this. Few people say polymorphism means multiple forms and they start giving example of draw function which is right to some extent but interviewer is looking for more detailed answer. Ability of base class pointer to call function from derived class at runtime is called polymorphism.  For example, there is super class human and there are two subclasses software engineer and hardware engineer. Now super class human can hold reference to any of subclass because software engineer is kind of human. Suppose there is speak function in super class and every subclass has also speak function. So at runtime, super class reference is pointing to whatever subclass, speak function will be called of that class. I hope I am able to make you understand.

45. What is responder chain?

Ans: Suppose you have a hierarchy of views such like there is superview A which have subview B and B has a subview C. Now you touch on inner most view C. The system will send touch event to subview C for handling this event. If C View does not want to handle this event, this event will be passed to its superview B (next responder). If B also does not want to handle this touch event it will pass on to superview A. All the view which can respond to touch events are called responder chain. A view can also pass its events to uiviewcontroller. If view controller also does not want to respond to touch event, it is passed to application object which discards this event.

46. What is Model View Controller?

MVC is a Design pattern.

Model stands for the database object which will manage all the database transaction.

View stands for the User Interface i.e. the UI visible to the user. User will be interacting  with the View. Controller is an object which handles the view events and also render the database changes to the UI. In short , it bridges the interaction between Modal and View.

47. What is @synthesize?

We use @synthesize to generate getters and setters automatically from compiler. We declare properties and then generate getter and setter method by using @synthesize.

48. Garbage collection in iOS?

iOS 5.0 has got the ARC ( Automated reference counting ). Objective C does not have a garbage collector rather it uses the reference coun

0 Dislike
Follow 0

Please Enter a comment

Submit

Other Lessons for You

Working With Arrays in Swift
Swift Arrays:Like Objective C arrays Swift arrays are also collection of Objects The Difference is in swift we don't work directly with addresses.The declaration of Swift array is as follows The above...

On the Job training is always best
On the job training always provides an opportunity to learn the best industry practices. While you work on real time you would encounter many challenges that will force you to learn many new things. Class...
M

Developing iOS Apps Part 1
The Basics Swift opts to use a Javascript-like ‘var’ keyword to define any new variable. So for example to create a new variable with a bit of text in it, you would have this: var...

P Balasubramanyam

0 0
0

10 Ways My Life Changed When I Learned To Code
1. I have freedom to make my own schedule. 2. I earn more, but work fewer hours. 3. I can say “no” to job offers. 4. People come to me asking if I can work for them. 5. I never have to...

Learning Path For Mobile Application Development
I. Traditional Approach: 1. Native Android Application Development: Android is a mobile operating system that runs on phones, tablets, smartwatches, TVs and more. You can learn Android Application Development...
X

Looking for iOS Developer Classes?

The best tutors for iOS Developer Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn iOS Developer with the Best Tutors

The best Tutors for iOS Developer Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more